public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/gdb: fix lx-lsmod refcnt
@ 2015-05-20 14:42 Adrien Schildknecht
  2015-05-22  5:32 ` Jan Kiszka
  0 siblings, 1 reply; 2+ messages in thread
From: Adrien Schildknecht @ 2015-05-20 14:42 UTC (permalink / raw)
  To: jan.kiszka, akpm, pktoss, adrien+dev; +Cc: linux-kernel

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>
---
 scripts/gdb/linux/modules.py | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py
index a1504c4..25db8cf 100644
--- a/scripts/gdb/linux/modules.py
+++ b/scripts/gdb/linux/modules.py
@@ -73,18 +73,11 @@ class LxLsmod(gdb.Command):
                 "        " 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()
-- 
2.4.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scripts/gdb: fix lx-lsmod refcnt
  2015-05-20 14:42 [PATCH] scripts/gdb: fix lx-lsmod refcnt Adrien Schildknecht
@ 2015-05-22  5:32 ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2015-05-22  5:32 UTC (permalink / raw)
  To: Adrien Schildknecht, akpm, pktoss; +Cc: linux-kernel

On 2015-05-20 16:42, Adrien Schildknecht wrote:
> 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>
> ---
>  scripts/gdb/linux/modules.py | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py
> index a1504c4..25db8cf 100644
> --- a/scripts/gdb/linux/modules.py
> +++ b/scripts/gdb/linux/modules.py
> @@ -73,18 +73,11 @@ class LxLsmod(gdb.Command):
>                  "        " 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()
> 

Thanks for fixing!

Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>

-- 
Siemens AG, Corporate Technology, CT RTC ITP SES-DE
Corporate Competence Center Embedded Linux

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-22  5:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-20 14:42 [PATCH] scripts/gdb: fix lx-lsmod refcnt Adrien Schildknecht
2015-05-22  5:32 ` Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox