Commit ca3f172c authored by Adrien Schildknecht's avatar Adrien Schildknecht Committed by Linus Torvalds

scripts/gdb: fix lx-lsmod refcnt

Commit 2f35c41f ("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: default avatarAdrien Schildknecht <adrien+dev@schischi.me>
Reviewed-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
Cc: Pantelis Koukousoulas <pktoss@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5a6b2b36
...@@ -73,18 +73,11 @@ class LxLsmod(gdb.Command): ...@@ -73,18 +73,11 @@ class LxLsmod(gdb.Command):
" " if utils.get_long_type().sizeof == 8 else "")) " " if utils.get_long_type().sizeof == 8 else ""))
for module in module_list(): 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( gdb.write("{address} {name:<19} {size:>8} {ref}".format(
address=str(module['module_core']).split()[0], address=str(module['module_core']).split()[0],
name=module['name'].string(), name=module['name'].string(),
size=str(module['core_size']), size=str(module['core_size']),
ref=str(ref))) ref=str(module['refcnt']['counter'])))
source_list = module['source_list'] source_list = module['source_list']
t = self._module_use_type.get_type().pointer() t = self._module_use_type.get_type().pointer()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment