aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/gdb/linux
diff options
context:
space:
mode:
authorAdrien Schildknecht <adrien+dev@schischi.me>2015-05-28 18:44:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-05-28 21:25:19 -0400
commitca3f172c197b5fa6b2693f5f93d4928a1420fb07 (patch)
treea7a68d53eb441e4b8661a54d14dab5c28e1c274b /scripts/gdb/linux
parent5a6b2b36a8249ec9dfb2a714acadad86d9cc0aee (diff)
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>
Diffstat (limited to 'scripts/gdb/linux')
-rw-r--r--scripts/gdb/linux/modules.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py
index a1504c4f1900..25db8cff44a2 100644
--- a/scripts/gdb/linux/modules.py
+++ b/scripts/gdb/linux/modules.py
@@ -73,18 +73,11 @@ class LxLsmod(gdb.Command):
73 " " if utils.get_long_type().sizeof == 8 else "")) 73 " " if utils.get_long_type().sizeof == 8 else ""))
74 74
75 for module in module_list(): 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 gdb.write("{address} {name:<19} {size:>8} {ref}".format( 76 gdb.write("{address} {name:<19} {size:>8} {ref}".format(
84 address=str(module['module_core']).split()[0], 77 address=str(module['module_core']).split()[0],
85 name=module['name'].string(), 78 name=module['name'].string(),
86 size=str(module['core_size']), 79 size=str(module['core_size']),
87 ref=str(ref))) 80 ref=str(module['refcnt']['counter'])))
88 81
89 source_list = module['source_list'] 82 source_list = module['source_list']
90 t = self._module_use_type.get_type().pointer() 83 t = self._module_use_type.get_type().pointer()