Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp194806rdb; Mon, 15 Jan 2024 18:10:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IEDpuy3brn7xuvycil2TciUjVLuUrhksVXysMhWPGmVLNaDkOcCxPmWuKNNAaeygWNSxdP+ X-Received: by 2002:a05:620a:1009:b0:781:3a8a:8eca with SMTP id z9-20020a05620a100900b007813a8a8ecamr7303734qkj.46.1705371017125; Mon, 15 Jan 2024 18:10:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705371017; cv=none; d=google.com; s=arc-20160816; b=jTdUmb2Ycg7Jv/XJMCrlOlBR3axchkr+AMIM32Ijblq5RmIlob/aaKXp87x94OVQoF ERUSCAnDbs9HyvagQF6bQH4Z1/Vt28fyUt0Je+Exn9Ql+1cbuuMauKhoIB6U0Y0SKyTP DJ1xQ+j0k+exDu+DmBVkOHyGmHJvIP3sg0VsTrmNO/HXdZJs09hMcdYz7j7/la7N/j3g IprxRbSlL+JRUVH62CDXEoqFrrwOatY63hUb/TFoUcURtDEi2XSHJU/aPlxaQ+DxHQut IMLCoagNUa1vt8HugxhItfsQN/VyBTTvx6Nb+pvvMVUvjMLQISHO7Bu61smyYU8WI/Dx 7C3Q== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26921-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s4-20020a05620a0bc400b00783339b493fsi9337855qki.232.2024.01.15.18.10.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 18:10:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26921-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26921-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26921-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A6CC21C228AD for ; Tue, 16 Jan 2024 02:10:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39EB54690; Tue, 16 Jan 2024 02:09:27 +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 Content-Transfer-Encoding: 8bit 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) -- 2.33.1