From patchwork Tue Jan 16 02:08:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruidong Tian X-Patchwork-Id: 188361 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:42cf:b0:101:a8e8:374 with SMTP id q15csp3463dye; Mon, 15 Jan 2024 18:10:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGt3PfT8WHx6y0f4daNvOc2W3Cl0oEIiJhAUBYmXxTtI1IJI+fF5VhvQ9PsR/VcM9FaHkEm X-Received: by 2002:a05:6870:e60a:b0:206:8095:7f78 with SMTP id q10-20020a056870e60a00b0020680957f78mr9044434oag.50.1705371026078; Mon, 15 Jan 2024 18:10:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705371026; cv=none; d=google.com; s=arc-20160816; b=Wkb9jv+mBYZRinbWCObGjWtHPF7iTk3X2RfwAsg/+D7wE5p3Z/FIE7jX3qbCd+b24n b37vn9kJgtrRbii8abo/3rVFW9IkMOktq5YIEEr6wwERDVMEymi/ODBALWW3hoI1+FLE zEzuc383S3bbK8LR40K4ej4UnVihlCg6IwA0PVJO7H25ZCZsGB2whCGiAiQui1cPJHjl BoFu5V9pfu2hwkJvV9c4DE2B/aTUXvh0DhrZrR6B4ke7fNbeHKmzZ7RYZ+bschZcVwNL jOcH9pZQDXdcqIh+Su64zzJRJGvL12FqIun4sEsLmDvsS3TtuB/C+GqcWgbcUVgxBJzY er9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=m3mUXWMvE1CbiBSf6/fyaZFBnvN1JIgT1dnBWraAosw=; fh=2C1f0j/nzSygmX2ABc+8OQYD53hkUy28AVWbjAwc8E0=; b=rG46g2GgCt4DRDeymi6w2y7ire1AreZM75o+FtVtg7HnsdiGW1BAN+aQKX9Pfj+rcy 68iZ8Oa1usPcwIyYlmSjAyUWAQxb97QiGQfkSxXqEcEeXjASp2C9lEcGtylZpIXHkyg+ UpSaxS74O4K0Z567caH+TnrdTcYZZEp3tPwENHtBqLrrAtif6MyF1x815xUJyGdv6dBo CflpQqdRf43TWtNqWhIQTti58xh88fWwyOTGKdjsJsUOD9jceB8BAFgfVL7HiqlRarEH 6/1Lreq5rBvS8BM8tZINyC3UbhdwzdO0i8zHX+vXzEyS+vbXyuVnGshUltm5adc4xtKc py5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26921-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26921-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d10-20020a65424a000000b005c2786b7e32si10109003pgq.812.2024.01.15.18.10.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 18:10:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26921-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26921-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26921-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.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 D305B284093 for ; Tue, 16 Jan 2024 02:10:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42D61F4E1; Tue, 16 Jan 2024 02:09:28 +0000 (UTC) Received: from out199-13.us.a.mail.aliyun.com (out199-13.us.a.mail.aliyun.com [47.90.199.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BD98ADF4A; Tue, 16 Jan 2024 02:09:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R561e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=tianruidong@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0W-kA6Fq_1705370948; Received: from localhost(mailfrom:tianruidong@linux.alibaba.com fp:SMTPD_---0W-kA6Fq_1705370948) by smtp.aliyun-inc.com; Tue, 16 Jan 2024 10:09:10 +0800 From: Ruidong Tian To: linux-kernel@vger.kernel.org Cc: james.clark@arm.com, 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, Ruidong Tian Subject: [PATCH v3 2/3] perf scripts python: arm-cs-trace-disasm.py: set start vm addr of exectable file to 0 Date: Tue, 16 Jan 2024 10:08:54 +0800 Message-Id: <20240116020854.56030-4-tianruidong@linux.alibaba.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20240116020854.56030-1-tianruidong@linux.alibaba.com> References: <20231214123304.34087-1-tianruidong@linux.alibaba.com> <20240116020854.56030-1-tianruidong@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785260635545762572 X-GMAIL-MSGID: 1788211129318783249 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)