Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756064AbbEVFce (ORCPT ); Fri, 22 May 2015 01:32:34 -0400 Received: from thoth.sbs.de ([192.35.17.2]:47985 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754712AbbEVFcd (ORCPT ); Fri, 22 May 2015 01:32:33 -0400 Message-ID: <555EBF6B.1030804@siemens.com> Date: Fri, 22 May 2015 07:32:27 +0200 From: Jan Kiszka User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: Adrien Schildknecht , akpm@linux-foundation.org, pktoss@gmail.com CC: linux-kernel@vger.kernel.org Subject: Re: [PATCH] scripts/gdb: fix lx-lsmod refcnt References: <1432132935-13489-1-git-send-email-adrien+dev@schischi.me> In-Reply-To: <1432132935-13489-1-git-send-email-adrien+dev@schischi.me> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1960 Lines: 50 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 > --- > 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 -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/