Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp633748rdb; Thu, 21 Dec 2023 23:29:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOiy17LbpFAkHx56cUqQ1LevACp8SQXA3diWbBifLbSu2mo1wkWRzquYSs2+0vhqHDLzFY X-Received: by 2002:a17:902:edd0:b0:1d3:ff84:8c97 with SMTP id q16-20020a170902edd000b001d3ff848c97mr842027plk.46.1703230190172; Thu, 21 Dec 2023 23:29:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703230190; cv=none; d=google.com; s=arc-20160816; b=BaKzZta8iAvH8jdwbhYEYTl33wkVNJ4NPwpyVjDmZeCy9203Q4K7WBccuQ7zahSgeW UtpYssGnaa0z2B3/2Shvr1V0XG8ufnEu+0bBAzx6bDjY9HFqzI80yjt0XwGohVU8Lyj4 /mmjDcpfdh4ISPltaIaveFtfhx7fh6hrOdba2IR9FHJM/JIvsIVIxFymFSiP7+qqsMNV k6Maz6QIK1YkiZlPUQZo5RBQVxGdSckT+gs3WGenEoCcVBy2eizy+jmwjihluqluRgQS LnWumP717jvGgoydNzdpOyoU6JuMA7ptWEj7DnvS8acQxNSI1uDWRbLyMGHopdJzlGze T6eQ== 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=+O1PcSdvStFkcydtV7WwtCP1EW4wfyJfUy0nAuES8T4=; fh=bODrHodWY3cspU2VgdZtZPZWIHvwC1o73RawCBLJvRw=; b=HbABzAv7Pt1QujNQq5itutyn7bvDL5ltTrbvmZN9hjS2mcuHShQDKIZBUzNr58kjpJ tk+htGzhBj0Q/rktoVnFQSj2csm7jI6UK64/2+PsYVy2H1YUWriVDRotWwuC8t6Uts99 QXDVyNClHJMzrhids7xpPnesnqud7pP0v8VuIwbFbayIBtKyFqvdhtBI14YMgMY+Az1r oExV819hEYiRTd82Ic4QIaba6mrcWkjVifRHJkRyuG+Pv/Ws7Uo3lo3lrnby+L/ymGmQ cacmn3bw+jC23XpllW6MN3mUqA1PgqSxtLtRJExX0QhPZre1JwHoCrKM+NVkA5oXZpvW cnmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-9439-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9439-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m2-20020a170902db0200b001d37369fdf0si2853466plx.304.2023.12.21.23.29.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 23:29:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9439-linux.lists.archive=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-9439-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9439-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A7BA2286240 for ; Fri, 22 Dec 2023 07:29:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4EE7B9475; Fri, 22 Dec 2023 07:29:29 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) (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 8DB068F7A; Fri, 22 Dec 2023 07:29:24 +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=01201311R771e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=tianruidong@linux.alibaba.com;NM=1;PH=DS;RN=14;SR=0;TI=SMTPD_---0Vz-.EL1_1703230160; Received: from 30.221.133.134(mailfrom:tianruidong@linux.alibaba.com fp:SMTPD_---0Vz-.EL1_1703230160) by smtp.aliyun-inc.com; Fri, 22 Dec 2023 15:29:22 +0800 Message-ID: <6177beec-f140-44aa-b534-182cd4b0a988@linux.alibaba.com> Date: Fri, 22 Dec 2023 15:29:18 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/3] perf scripts python: arm-cs-trace-disasm.py: print dso base address Content-Language: en-US To: James Clark , 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-2-tianruidong@linux.alibaba.com> <912a39f4-025e-26a1-7786-091fa211f293@arm.com> From: Ruidong Tian In-Reply-To: <912a39f4-025e-26a1-7786-091fa211f293@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi James 在 2023/12/20 18:44, James Clark 写道: > > On 14/12/2023 12:33, Ruidong Tian wrote: >> arm-cs-trace-disasm just print offset for library dso: >> >> 0000000000002200 : >> 2200: d503201f nop >> 2204: 8b020024 add x4, x1, x2 >> 2208: 8b020005 add x5, x0, x2 >> >> This print DSO base address to get complete virtual address for >> userspace application: >> >> 0000000000002200 : (base address is 0x0000ffffb4c21000) >> 2200: d503201f nop >> 2204: 8b020024 add x4, x1, x2 >> 2208: 8b020005 add x5, x0, x2 >> > I believe the output format without the base address is consistent with > objdump. For compatibility I would say that it's better to keep it that way. Sure, the output is totally corrected, i just print the base address rather than modify the output address, i don't think this change is incompatible. > > We could add this as an option, but have it disabled by default. I > suppose it depends how likely that someone is using this output in a > tool and processing it further whether an option is needed or not. I want to get the runtime trace flow with virtual address, i can get the trace information with virtual address in `perf report` and `perf script` by default, so i think it is more reasonable to print virtual address in arm-cs-trace-disasm script by default. > > Although it's also not that clear what this is useful for, given that > all the other output is relative too? Maybe you could add an example to > the commit message, even if it's just for debugging. Would an option > that turned _all_ the output into virtual addresses not be more useful? I want to use arm-cs-trace-disasm.py output associate with PMU and SPE data to explore more CPU performance info, all the PMU/SPE/Coresight informations generated by `perf report` and `perf script` include virtual address, so i want this script do the same thing. > > Thanks > James > >> Signed-off-by: Ruidong Tian >> --- >> tools/perf/scripts/python/arm-cs-trace-disasm.py | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py >> index d59ff53f1d94..46bf6b02eea1 100755 >> --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py >> +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py >> @@ -108,6 +108,8 @@ def print_disam(dso_fname, dso_start, start_addr, stop_addr): >> m = disasm_re.search(line) >> if m is None: >> continue >> + else: >> + line += " (base address is 0x%016x)" % dso_start >> print("\t" + line) >> >> def print_sample(sample):