From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 381F7C3DA6E for ; Wed, 20 Dec 2023 12:07:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IFqsuI24MspUKvTvtRS9iMroUkaFZflmOx+TYjx2hT8=; b=htjdo1Ex+ZWdHZ vwPLaiMw152YuYwE2fYW173/MuBr7osP6359lcsir2MbzsvziHphsalUv81aDPNMQ4+lNPwovTofl ONx85Pf50VvbS4pGD/VXpefCiReg6Dc1wpWBK18E6Q7+SWmcXHR+AdxHNjVqcXRePZx8mfSUFFML5 H2Ux0LXNOfTFfP8/Z41t54ebYMnJJR+BJ7eBzaaXxsf9G92hRgiMXp0WIDFfUEmDJpjHxJzcXQtMR lu2GNUFGEJ70/pxwcgo0MRQXVqzm5/I6adtvKLLmN4ZEzrGq7USKuU1VsUqZE0MhR1QNuPh/BDbX1 1wj/mgeXMtP58/lu4Zog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFvLs-00HIk9-2s; Wed, 20 Dec 2023 12:07:04 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rFvLq-00HIjo-1R for linux-arm-kernel@lists.infradead.org; Wed, 20 Dec 2023 12:07:03 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B19171FB; Wed, 20 Dec 2023 04:07:46 -0800 (PST) Received: from [192.168.1.3] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 40BF53F5A1; Wed, 20 Dec 2023 04:07:00 -0800 (PST) Message-ID: Date: Wed, 20 Dec 2023 12:06:59 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 2/3] perf scripts python: arm-cs-trace-disasm.py: set start vm addr of exectable file to 0 Content-Language: en-US To: Ruidong Tian , linux-kernel@vger.kernel.org Cc: coresight@lists.linaro.org, suzuki.poulose@arm.com, mike.leach@linaro.org, alexander.shishkin@linux.intel.com, linux-arm-kernel@lists.infradead.org, adrian.hunter@intel.com, linux-perf-users@vger.kernel.org, leo.yan@linaro.org, al.grant@arm.com, mathieu.poirier@linaro.org, tor@ti.com, acme@redhat.com References: <20231214123304.34087-1-tianruidong@linux.alibaba.com> <20231214123304.34087-3-tianruidong@linux.alibaba.com> From: James Clark In-Reply-To: <20231214123304.34087-3-tianruidong@linux.alibaba.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231220_040702_554875_72316B1D X-CRM114-Status: GOOD ( 19.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 14/12/2023 12:33, Ruidong Tian wrote: > For exectable ELF file, which e_type is ET_EXEC, dso start address is a > absolute address other than offset. Just set vm_start to zero when dso > start is 0x400000, which means it is a exectable file. > > Signed-off-by: Ruidong Tian > --- > tools/perf/scripts/python/arm-cs-trace-disasm.py | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py > index 46bf6b02eea1..c9e14af5b58c 100755 > --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py > +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py > @@ -260,8 +260,9 @@ def process_event(param_dict): > > if (options.objdump_name != None): > # It doesn't need to decrease virtual memory offset for disassembly > - # for kernel dso, so in this case we set vm_start to zero. > - if (dso == "[kernel.kallsyms]"): > + # for kernel dso and executable file dso, so in this case we set > + # vm_start to zero. > + if (dso == "[kernel.kallsyms]" or dso_start == 0x400000): > dso_vm_start = 0 > else: > dso_vm_start = int(dso_start) I confirmed that this fixes the disassembly for static binaries. It would have been nice to check the type of the file rather than using a magic number, but it's not that easy and I don't really see a chance of the number having a false positive. I wonder if it's worth putting a fixes tag on this one? For the other ones I'd say no tag as they have a chance of breaking things. Reviewed-by: James Clark _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel