Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2999768rwl; Thu, 13 Apr 2023 14:13:11 -0700 (PDT) X-Google-Smtp-Source: AKy350Y44LtaOV3SDvewSlJYFLgu0vcmMYIpH/BPStekeXTAhmK8h8RoqIwVXLXEdGz1FGpM3kL9 X-Received: by 2002:a17:90a:9113:b0:233:76bd:9faa with SMTP id k19-20020a17090a911300b0023376bd9faamr3261137pjo.47.1681420391008; Thu, 13 Apr 2023 14:13:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681420390; cv=none; d=google.com; s=arc-20160816; b=gEWrjDIobvQ2fDQ6e3/BnUtW8SnoFNflAD/o/e4ULJBL8fcuu0I4qVQ0sBLw2Puzvk B3+sCbEw+/eWuHEHgysqIkhRKWJqJkYBYVbtBe53NSDoS2EUlUabEv1fTQK9bTZdvKXK 41tK9cfQREhGv27+NthCweRfrS9vyjoJ0hmB0e2YS2d4u7474YUj9QTDnDplmB5csQpa SfCGZmEvZ2U934nV/JtLk1JZzlpnWsfQVQ/mg4RqISuvgKlUtDWQNLrY6awrAw0oBpAJ 0SMt26S6D8QM8Y9Wpm2SQoISbfo6Uu8VtuiJN06F6R96a4/jS5X5ADrOdIEmmL3XHJPb JMsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=lWHvvlZBi8wuHY5YcSEWxlnVkh/RZd3Sjjp43kSWVsI=; b=F8q2ot1HUR5eS+fULqsM3xfw79OF1asEUiD3YzDUmGS0HM/Lpi0XYCMBRJb2GumohW x0aHDi66KvKirRUcfLpVb2kwZg39P/kEdQClaCi7cuzrAmFmNqmtkHuTXX7e8Hx4M+vf p1/QFjV+uQmvyAU05vJhS4hXPLeFSL/R0R3hTqboI7/Sq40Vf8+YvcQqxKaKzwmq8/pu gLSP1K6mA915yQXQ33ovInzOUUyRo/5119Mg5llaetLBWKq1IRVBi8a5GC3uXY/CEpFD 45DWsPCVW6SDipH4F1TrrMLcENMdCXWkdftjizaY0fjoeUpVn01RwOcBWxOIN0ypEsqe yxSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=tTt8w1Hf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u186-20020a6385c3000000b0051b50a97bcasi2321500pgd.477.2023.04.13.14.12.58; Thu, 13 Apr 2023 14:13:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=tTt8w1Hf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229913AbjDMVFA (ORCPT + 99 others); Thu, 13 Apr 2023 17:05:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbjDMVE6 (ORCPT ); Thu, 13 Apr 2023 17:04:58 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0A1093C0 for ; Thu, 13 Apr 2023 14:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=lWHvvlZBi8wuHY5YcSEWxlnVkh/RZd3Sjjp43kSWVsI=; b=tTt8w1Hfa/1lY2LeASbReZddgw byAxRIaM7SeY9pUI/gmTNckPYuRh9SnLHqrKrsh0iGZfykTQ4xNnuDx8xtAi28zBpAGFYd2XEIjdL wx2zJ0gjdNfbNO7hPhl6h6YN+wSQvEzRBejmipxiq2uUoDJY0oz9yHhF0x2zAZiSlVlHpAAuCMR93 PSnAMy60ihcOR052VJmT3YOT2oWoTwTOrLQHEqrzjdLe/abwHU9b6nYlo3X36ujWSfkOoaLyAJmnh wqP2pICuY+3kmx853TOB3EESO0DDzJ6z2VRGx3+EQRrHrpvZbg1hLYbPWsMTEHXDoEFvtrYAf1l0Q 3/xrjFaA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pn47d-0079VV-0n; Thu, 13 Apr 2023 21:04:49 +0000 Date: Thu, 13 Apr 2023 14:04:49 -0700 From: Luis Chamberlain To: Kieran Bingham Cc: Pankaj Raghav , jan.kiszka@siemens.com, kbingham@kernel.org, gost.dev@samsung.com, linux-kernel@vger.kernel.org, song@kernel.org, Florian Fainelli Subject: Re: [PATCH v2] scripts/gdb: use mem instead of core_layout to get the module address Message-ID: References: <20230412202516.1027149-1-p.raghav@samsung.com> <168139365042.2373830.5173244303178460397@Monstersaurus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <168139365042.2373830.5173244303178460397@Monstersaurus> Sender: Luis Chamberlain X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 13, 2023 at 02:47:30PM +0100, Kieran Bingham wrote: > Quoting Pankaj Raghav (2023-04-13 08:44:38) > > On 2023-04-13 02:53, Luis Chamberlain wrote: > > > On Wed, Apr 12, 2023 at 10:25:18PM +0200, Pankaj Raghav wrote: > > >> commit ac3b43283923 ("module: replace module_layout with module_memory") > > >> changed the struct module data structure from module_layout to > > >> module_memory. The core_layout member which is used while loading > > >> modules are not available anymore leading to the following error while > > >> running gdb: > > >> > > >> (gdb) lx-symbols > > >> loading vmlinux > > >> Python Exception : There is no member named core_layout. > > >> Error occurred in Python: There is no member named core_layout. > > >> > > >> Replace core_layout with its new counterpart mem[MOD_TEXT]. > > >> > > >> Fixes: ac3b43283923 ("module: replace module_layout with module_memory") > > >> Signed-off-by: Pankaj Raghav > > >> --- > > >> scripts/gdb/linux/constants.py.in | 3 +++ > > >> scripts/gdb/linux/modules.py | 4 ++-- > > >> scripts/gdb/linux/symbols.py | 4 ++-- > > >> 3 files changed, 7 insertions(+), 4 deletions(-) > > >> > > >> diff --git a/scripts/gdb/linux/constants.py.in b/scripts/gdb/linux/constants.py.in > > >> index 36fd2b145853..471300ba176c 100644 > > >> --- a/scripts/gdb/linux/constants.py.in > > >> +++ b/scripts/gdb/linux/constants.py.in > > >> @@ -62,6 +62,9 @@ LX_GDBPARSED(hrtimer_resolution) > > >> LX_GDBPARSED(IRQD_LEVEL) > > >> LX_GDBPARSED(IRQ_HIDDEN) > > >> > > >> +/* linux/module.h */ > > >> +LX_GDBPARSED(MOD_TEXT) > > > > > > Should we just fill in the rest of the other sections too while at it? > > > > > > > I don't see them used in the scripts. Maybe we can add them when needed? > > I think there's a runtime-cost to getting these constants, as we > interogate GDB to get the values. > > Because of that, I think values should only be added when required, > unless the python code is only lazy-evaluating these. OK thanks, applied and pushed to modules-next. Luis