Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scripts/gdb: fix lx-lsmod refcnt

Commit 2f35c41f58a9 ("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>

authored by

Adrien Schildknecht and committed by
Linus Torvalds
ca3f172c 5a6b2b36

+1 -8
+1 -8
scripts/gdb/linux/modules.py
··· 73 73 " " if utils.get_long_type().sizeof == 8 else "")) 74 74 75 75 for module in module_list(): 76 - ref = 0 77 - module_refptr = module['refptr'] 78 - for cpu in cpus.cpu_list("cpu_possible_mask"): 79 - refptr = cpus.per_cpu(module_refptr, cpu) 80 - ref += refptr['incs'] 81 - ref -= refptr['decs'] 82 - 83 76 gdb.write("{address} {name:<19} {size:>8} {ref}".format( 84 77 address=str(module['module_core']).split()[0], 85 78 name=module['name'].string(), 86 79 size=str(module['core_size']), 87 - ref=str(ref))) 80 + ref=str(module['refcnt']['counter']))) 88 81 89 82 source_list = module['source_list'] 90 83 t = self._module_use_type.get_type().pointer()