[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7861aef3-8c0f-8ab3-6bd5-243eba3200b8@arm.com>
Date: Wed, 17 Jan 2024 10:16:03 +0000
From: James Clark <james.clark@....com>
To: Ruidong Tian <tianruidong@...ux.alibaba.com>, linux-kernel@...r.kernel.org
Cc: coresight@...ts.linaro.org, suzuki.poulose@....com,
mike.leach@...aro.org, alexander.shishkin@...ux.intel.com,
linux-arm-kernel@...ts.infradead.org, adrian.hunter@...el.com,
linux-perf-users@...r.kernel.org, leo.yan@...aro.org, al.grant@....com,
mathieu.poirier@...aro.org, tor@...com, acme@...hat.com
Subject: Re: [PATCH v3 1/1] perf scripts python: arm-cs-trace-disasm.py: add
option to print virtual address
On 16/01/2024 02:08, Ruidong Tian wrote:
> arm-cs-trace-disasm just print offset for library dso now:
>
> 0000000000002200 <memcpy>:
> 2200: d503201f nop
> 2204: 8b020024 add x4, x1, x2
> 2208: 8b020005 add x5, x0, x2
>
> Add a option `-a` to print virtual offset other than offset:
>
> # perf script -s scripts/python/arm-cs-trace-disasm.py -- -d llvm-objdump -a
> ...
> ffffb4c23200 <memcpy>:
> ffffb4c23200: d503201f nop
> ffffb4c23204: 8b020024 add x4, x1, x2
> ffffb4c23208: 8b020005 add x5, x0, x2
> ...
>
> Signed-off-by: Ruidong Tian <tianruidong@...ux.alibaba.com>
> Reviewed-by: Leo Yan <leo.yan@...aro.org>
I think your s-o-b should always come last, so these should be the other
way around.
Also patch 3 is missing on v3 for some reason so you might want to
resend. No need to send it as a reply to the thread, you can just send
it as a complete new one.
Thanks
James
> ---
> tools/perf/scripts/python/arm-cs-trace-disasm.py | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/scripts/python/arm-cs-trace-disasm.py b/tools/perf/scripts/python/arm-cs-trace-disasm.py
> index d973c2baed1c..78419498237e 100755
> --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py
> +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py
> @@ -36,7 +36,10 @@ option_list = [
> help="Set path to objdump executable file"),
> make_option("-v", "--verbose", dest="verbose",
> action="store_true", default=False,
> - help="Enable debugging log")
> + help="Enable debugging log"),
> + make_option("-a", "--vaddr", dest="vaddr",
> + action="store_true", default=False,
> + help="Enable virtual address")
> ]
>
> parser = OptionParser(option_list=option_list)
> @@ -108,6 +111,14 @@ def print_disam(dso_fname, dso_start, start_addr, stop_addr):
> m = disasm_re.search(line)
> if m is None:
> continue
> +
> + # Replace offset with virtual address
> + if (options.vaddr == True):
> + offset = re.search(r"^\s*([0-9a-fA-F]+)", line).group()
> + if offset:
> + virt_addr = dso_start + int(offset, 16)
> + line = line.replace(offset.lstrip(), "%x" % virt_addr)
> +
> print("\t" + line)
>
> def print_sample(sample):
Powered by blists - more mailing lists