scripts/gdb: fix lx-lsmod refcnt

Commit 2f35c41f58 ("module: Replace module_ref with atomic_t refcnt")
changes the way refcnt is handled but did not update the gdb script to
use the new variable.

Since refcnt is not per-cpu anymore, we can directly read its value.

Signed-off-by: Adrien Schildknecht <[email protected]>
Reviewed-by: Jan Kiszka <[email protected]>
Cc: Pantelis Koukousoulas <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Adrien Schildknecht authored and Linus Torvalds committed 2015-05-28 18:25:19 -07:00
1 parent 5a6b2b36a8
commit ca3f172c19
1 file changed
+1 -8
+1 -8
View File
@@ -73,18 +73,11 @@ class LxLsmod(gdb.Command):
" " if utils.get_long_type().sizeof == 8 else ""))
for module in module_list():
ref = 0
module_refptr = module['refptr']
for cpu in cpus.cpu_list("cpu_possible_mask"):
refptr = cpus.per_cpu(module_refptr, cpu)
ref += refptr['incs']
ref -= refptr['decs']
gdb.write("{address} {name:<19} {size:>8} {ref}".format(
address=str(module['module_core']).split()[0],
name=module['name'].string(),
size=str(module['core_size']),
ref=str(ref)))
ref=str(module['refcnt']['counter'])))
source_list = module['source_list']
t = self._module_use_type.get_type().pointer()