Skip to content

Commit

Permalink
scripts/gdb: fix lx-lsmod refcnt
Browse files Browse the repository at this point in the history
Commit 2f35c41 ("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 <adrien+dev@schischi.me>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Pantelis Koukousoulas <pktoss@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Adrien Schildknecht authored and Linus Torvalds committed May 29, 2015
1 parent 5a6b2b3 commit ca3f172
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions scripts/gdb/linux/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,11 @@ def invoke(self, arg, from_tty):
" " 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()
Expand Down

0 comments on commit ca3f172

Please sign in to comment.