scripts/gdb: Adjust module reference counter reported by lx-lsmod
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 23 May 2016 23:24:37 +0000 (16:24 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 24 May 2016 00:04:14 +0000 (17:04 -0700)
This takes the MODULE_REF_BASE into account.

Link: http://lkml.kernel.org/r/d926d2d54caa034adb964b52215090cbdb875249.1462865983.git.jan.kiszka@siemens.com
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/gdb/linux/modules.py

index 0a35d6dbfb8043d7568cf05f3cca79fd756ea85c..38f5d17044c5226fb84eb638c53ccaed2e7d5715 100644 (file)
@@ -78,7 +78,7 @@ class LxLsmod(gdb.Command):
                 address=str(layout['base']).split()[0],
                 name=module['name'].string(),
                 size=str(layout['size']),
-                ref=str(module['refcnt']['counter'])))
+                ref=str(module['refcnt']['counter'] - 1)))
 
             source_list = module['source_list']
             t = self._module_use_type.get_type().pointer()