Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH] perf scripts python: cs-etm: Update example to provide vmlinux path to Perf
@ 2024-07-24 14:33 James Clark
  2024-07-24 15:00 ` Leo Yan
  0 siblings, 1 reply; 4+ messages in thread
From: James Clark @ 2024-07-24 14:33 UTC (permalink / raw)
  To: coresight, gankulkarni, mike.leach, leo.yan, suzuki.poulose
  Cc: James Clark, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Liang, Kan, Ruidong Tian, Benjamin Gray, linux-perf-users,
	linux-kernel

The example shows the vmlinux path being given to the script, but this
only works when running on the target. If the script is run off the
target, then confusingly the vmlinux argument also needs to be given to
Perf as well.

Without going into too much detail in the example about when it is or
isn't required, just include it. It doesn't do any harm even when
running on the target. Now the example command works in both places.

Signed-off-by: James Clark <james.clark@linaro.org>
---
 tools/perf/scripts/python/arm-cs-trace-disasm.py | 4 ++--
 1 file changed, 2 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 7aff02d84ffb..4aeb9b497f7a 100755
--- a/tools/perf/scripts/python/arm-cs-trace-disasm.py
+++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py
@@ -19,10 +19,10 @@ from perf_trace_context import perf_set_itrace_options, \
 # Below are some example commands for using this script.
 #
 # Output disassembly with objdump:
-#  perf script -s scripts/python/arm-cs-trace-disasm.py \
+#  perf script -k path/to/vmlinux -s scripts/python/arm-cs-trace-disasm.py \
 #		-- -d objdump -k path/to/vmlinux
 # Output disassembly with llvm-objdump:
-#  perf script -s scripts/python/arm-cs-trace-disasm.py \
+#  perf script -k path/to/vmlinux -s scripts/python/arm-cs-trace-disasm.py \
 #		-- -d llvm-objdump-11 -k path/to/vmlinux
 # Output only source line and symbols:
 #  perf script -s scripts/python/arm-cs-trace-disasm.py
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf scripts python: cs-etm: Update example to provide vmlinux path to Perf
  2024-07-24 14:33 [PATCH] perf scripts python: cs-etm: Update example to provide vmlinux path to Perf James Clark
@ 2024-07-24 15:00 ` Leo Yan
  2024-07-24 15:23   ` James Clark
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Yan @ 2024-07-24 15:00 UTC (permalink / raw)
  To: James Clark, coresight, gankulkarni, mike.leach, suzuki.poulose
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Liang, Kan, Ruidong Tian,
	Benjamin Gray, linux-perf-users, linux-kernel

On 7/24/2024 3:33 PM, James Clark wrote:
> 
> The example shows the vmlinux path being given to the script, but this
> only works when running on the target. If the script is run off the
> target, then confusingly the vmlinux argument also needs to be given to
> Perf as well.
> 
> Without going into too much detail in the example about when it is or
> isn't required, just include it. It doesn't do any harm even when
> running on the target. Now the example command works in both places.
> 
> Signed-off-by: James Clark <james.clark@linaro.org>

The change makes senses to me.  Just check a bit, does it need to add the same
option for the command "only source line and symbols"?

Thanks,
Leo

> ---
>  tools/perf/scripts/python/arm-cs-trace-disasm.py | 4 ++--
>  1 file changed, 2 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 7aff02d84ffb..4aeb9b497f7a 100755
> --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py
> +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py
> @@ -19,10 +19,10 @@ from perf_trace_context import perf_set_itrace_options, \
>  # Below are some example commands for using this script.
>  #
>  # Output disassembly with objdump:
> -#  perf script -s scripts/python/arm-cs-trace-disasm.py \
> +#  perf script -k path/to/vmlinux -s scripts/python/arm-cs-trace-disasm.py \
>  #              -- -d objdump -k path/to/vmlinux
>  # Output disassembly with llvm-objdump:
> -#  perf script -s scripts/python/arm-cs-trace-disasm.py \
> +#  perf script -k path/to/vmlinux -s scripts/python/arm-cs-trace-disasm.py \
>  #              -- -d llvm-objdump-11 -k path/to/vmlinux
>  # Output only source line and symbols:
>  #  perf script -s scripts/python/arm-cs-trace-disasm.py
> --
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf scripts python: cs-etm: Update example to provide vmlinux path to Perf
  2024-07-24 15:00 ` Leo Yan
@ 2024-07-24 15:23   ` James Clark
  2024-07-24 15:35     ` Leo Yan
  0 siblings, 1 reply; 4+ messages in thread
From: James Clark @ 2024-07-24 15:23 UTC (permalink / raw)
  To: Leo Yan
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Liang, Kan, Ruidong Tian,
	Benjamin Gray, linux-perf-users, linux-kernel, coresight,
	gankulkarni, mike.leach, suzuki.poulose



On 24/07/2024 4:00 pm, Leo Yan wrote:
> On 7/24/2024 3:33 PM, James Clark wrote:
>>
>> The example shows the vmlinux path being given to the script, but this
>> only works when running on the target. If the script is run off the
>> target, then confusingly the vmlinux argument also needs to be given to
>> Perf as well.
>>
>> Without going into too much detail in the example about when it is or
>> isn't required, just include it. It doesn't do any harm even when
>> running on the target. Now the example command works in both places.
>>
>> Signed-off-by: James Clark <james.clark@linaro.org>
> 
> The change makes senses to me.  Just check a bit, does it need to add the same
> option for the command "only source line and symbols"?
> 
> Thanks,
> Leo
> 

I assumed that because that one didn't have vmlinux at all then it's 
just for userspace tracing. I think it's good to have an example without 
vmlinux to show that it's not a strict requirement.

>> ---
>>   tools/perf/scripts/python/arm-cs-trace-disasm.py | 4 ++--
>>   1 file changed, 2 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 7aff02d84ffb..4aeb9b497f7a 100755
>> --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py
>> +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py
>> @@ -19,10 +19,10 @@ from perf_trace_context import perf_set_itrace_options, \
>>   # Below are some example commands for using this script.
>>   #
>>   # Output disassembly with objdump:
>> -#  perf script -s scripts/python/arm-cs-trace-disasm.py \
>> +#  perf script -k path/to/vmlinux -s scripts/python/arm-cs-trace-disasm.py \
>>   #              -- -d objdump -k path/to/vmlinux
>>   # Output disassembly with llvm-objdump:
>> -#  perf script -s scripts/python/arm-cs-trace-disasm.py \
>> +#  perf script -k path/to/vmlinux -s scripts/python/arm-cs-trace-disasm.py \
>>   #              -- -d llvm-objdump-11 -k path/to/vmlinux
>>   # Output only source line and symbols:
>>   #  perf script -s scripts/python/arm-cs-trace-disasm.py
>> --
>> 2.34.1
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] perf scripts python: cs-etm: Update example to provide vmlinux path to Perf
  2024-07-24 15:23   ` James Clark
@ 2024-07-24 15:35     ` Leo Yan
  0 siblings, 0 replies; 4+ messages in thread
From: Leo Yan @ 2024-07-24 15:35 UTC (permalink / raw)
  To: James Clark
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
	Ian Rogers, Adrian Hunter, Liang, Kan, Ruidong Tian,
	Benjamin Gray, linux-perf-users, linux-kernel, coresight,
	gankulkarni, mike.leach, suzuki.poulose

On 7/24/2024 4:23 PM, James Clark wrote:

[...]

>> The change makes senses to me.  Just check a bit, does it need to add the same
>> option for the command "only source line and symbols"?
> 
> I assumed that because that one didn't have vmlinux at all then it's
> just for userspace tracing.
For the only source and symbols case, I expect it will can be used for kernel
tracing as well, as this can save much time if someone doesn't care about
disassembly.

Maybe it is good to add the same option for it, even though it is not used for
user space tracing. Either is fine for me:

Reviewed-by: Leo Yan <leo.yan@arm.com>

> I think it's good to have an example without
> vmlinux to show that it's not a strict requirement.

>>> ---
>>>   tools/perf/scripts/python/arm-cs-trace-disasm.py | 4 ++--
>>>   1 file changed, 2 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 7aff02d84ffb..4aeb9b497f7a 100755
>>> --- a/tools/perf/scripts/python/arm-cs-trace-disasm.py
>>> +++ b/tools/perf/scripts/python/arm-cs-trace-disasm.py
>>> @@ -19,10 +19,10 @@ from perf_trace_context import perf_set_itrace_options, \
>>>   # Below are some example commands for using this script.
>>>   #
>>>   # Output disassembly with objdump:
>>> -#  perf script -s scripts/python/arm-cs-trace-disasm.py \
>>> +#  perf script -k path/to/vmlinux -s scripts/python/arm-cs-trace-disasm.py \
>>>   #              -- -d objdump -k path/to/vmlinux
>>>   # Output disassembly with llvm-objdump:
>>> -#  perf script -s scripts/python/arm-cs-trace-disasm.py \
>>> +#  perf script -k path/to/vmlinux -s scripts/python/arm-cs-trace-disasm.py \
>>>   #              -- -d llvm-objdump-11 -k path/to/vmlinux
>>>   # Output only source line and symbols:
>>>   #  perf script -s scripts/python/arm-cs-trace-disasm.py
>>> -- 
>>> 2.34.1
>>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-07-24 15:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-24 14:33 [PATCH] perf scripts python: cs-etm: Update example to provide vmlinux path to Perf James Clark
2024-07-24 15:00 ` Leo Yan
2024-07-24 15:23   ` James Clark
2024-07-24 15:35     ` Leo Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox