Received: by 2002:a05:7412:d002:b0:f9:9049:d2ea with SMTP id bd2csp60127rdb; Wed, 20 Dec 2023 04:07:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJINzu2jUWyD6VO5k/SaaeOz543CUDkw1XNWHr/xpFp1+l1/ZtqsepzxE7IsMLESf41XNA X-Received: by 2002:a62:e213:0:b0:6d9:5bc0:3423 with SMTP id a19-20020a62e213000000b006d95bc03423mr382387pfi.47.1703074031729; Wed, 20 Dec 2023 04:07:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703074031; cv=none; d=google.com; s=arc-20160816; b=C1Gu8onI9kPIFq6N+ZJsAisvRhx+8qnPHhyqbnytFkGhy7yYM+Y1qwx35HdiyjC2Hk l5+8nL+cPG/b1SiWsO/rtOp67bGxuExt3WmZ7i9uVijP1Vftnt6KAEnwCtjazwF8MK5y OX92AruXfN+Gyfx0m3IscFMwXF9rkaOppdjt5JzTXWb8OXvQXAZdXPmbs6ZP3/ggrrs8 FIYr4wop89USfEwB5sCFXm5/nbZvoIv33Wx+OXBoun2qRjsH17l/FgrngtyqtYYOsPT8 yVJE6BWvJ7iwj2y5yYkvq2qGBcXezJ6XU8/laSvb2qEEnjyhHRqkvg00U09NhQ9VbpaS RNJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=LkzCiI8T2lz9QfC5A52PbSUPPoN9i6aKV2c7HYBElS0=; fh=ZFKVi2es5n47ouapEVqO1zmV1KHdoZ676SFGRdbsYmk=; b=DdHIwQEoUHdD7IBPi0uZbsZ2zQ9s0jFVRjNYxRZsCIIQ6PxrQ93CHbwHePU+0Dck/D S6l/sKJC2xRdRMF0ZQIWfMrgbr8+lTPV+2c4+Y8SMTwHPNJZx4AwnxDU5k1pkbdJ1nfk NDmMiMnEPIqWNASh9o/tKfZiUGX6DcCGtyUS73xWmyjcanX0rf2fzpzGXQYtdPQ2swNz pts1pq9zHsuV8Il8RAXcs7+KL+nm4sSgHeokY3rTLJrfy4ypIQ61oursy3TDSjZrqZdu bnDr21G+wtOie9YXu8petov454VSO1sXn+qMOKfGT7Q/s0FJ81be8zZ3vCbH86LoTKFX E5Uw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-6864-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6864-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ct18-20020a056a000f9200b006d93f434822si2115212pfb.386.2023.12.20.04.07.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 04:07:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6864-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-6864-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6864-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E809128616F for ; Wed, 20 Dec 2023 12:07:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AFBE22304; Wed, 20 Dec 2023 12:07:04 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 70BE122303; Wed, 20 Dec 2023 12:07:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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