From: Ruidong Tian <tianruidong@linux.alibaba.com>
To: James Clark <james.clark@arm.com>, 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
Subject: Re: [PATCH 1/3] perf scripts python: arm-cs-trace-disasm.py: print dso base address
Date: Fri, 22 Dec 2023 15:29:18 +0800 [thread overview]
Message-ID: <6177beec-f140-44aa-b534-182cd4b0a988@linux.alibaba.com> (raw)
In-Reply-To: <912a39f4-025e-26a1-7786-091fa211f293@arm.com>
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 <memcpy>:
>> 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 <memcpy>: (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 <tianruidong@linux.alibaba.com>
>> ---
>> 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):
next prev parent reply other threads:[~2023-12-22 7:29 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-14 12:33 [PATCH 0/3] perf scripts python: arm-cs-trace-disasm.py: Ruidong Tian
2023-12-14 12:33 ` [PATCH 1/3] perf scripts python: arm-cs-trace-disasm.py: print dso base address Ruidong Tian
2023-12-20 10:44 ` James Clark
2023-12-22 7:29 ` Ruidong Tian [this message]
2023-12-24 8:33 ` Leo Yan
2023-12-14 12:33 ` [PATCH 2/3] perf scripts python: arm-cs-trace-disasm.py: set start vm addr of exectable file to 0 Ruidong Tian
2023-12-20 12:06 ` James Clark
2023-12-14 12:33 ` [PATCH 3/3] perf scripts python: arm-cs-trace-disasm.py: do not ignore disam first sample Ruidong Tian
2023-12-18 20:28 ` Arnaldo Carvalho de Melo
2023-12-20 11:15 ` James Clark
2023-12-20 17:31 ` [PATCH 0/3] perf scripts python: arm-cs-trace-disasm.py: Arnaldo Carvalho de Melo
2024-01-10 2:56 ` [PATCH v2 0/1] perf scripts python: arm-cs-trace-disasm.py: print correct disasm info Ruidong Tian
2024-01-10 2:56 ` [PATCH v2 1/1] perf scripts python: arm-cs-trace-disasm.py: add option to print virtual address Ruidong Tian
2024-01-10 12:55 ` Leo Yan
2024-01-10 13:48 ` Ruidong Tian
2024-01-16 2:08 ` [PATCH v3 0/1] perf scripts python: arm-cs-trace-disasm.py: print correct disasm info Ruidong Tian
2024-01-16 2:08 ` [PATCH v3 1/1] perf scripts python: arm-cs-trace-disasm.py: add option to print virtual address Ruidong Tian
2024-01-17 10:16 ` James Clark
2024-01-16 2:08 ` [PATCH v3 2/3] perf scripts python: arm-cs-trace-disasm.py: set start vm addr of exectable file to 0 Ruidong Tian
2024-01-17 10:12 ` James Clark
2024-01-16 2:08 ` Ruidong Tian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6177beec-f140-44aa-b534-182cd4b0a988@linux.alibaba.com \
--to=tianruidong@linux.alibaba.com \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=al.grant@arm.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=coresight@lists.linaro.org \
--cc=james.clark@arm.com \
--cc=leo.yan@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=mike.leach@linaro.org \
--cc=suzuki.poulose@arm.com \
--cc=tor@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®