* [PATCH] perf script: Always allow field 'data_src' for auxtrace
@ 2022-04-17 11:48 Leo Yan
2022-04-18 14:45 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 2+ messages in thread
From: Leo Yan @ 2022-04-17 11:48 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Adrian Hunter, Peter Zijlstra,
Ingo Molnar, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Namhyung Kim, James Clark, German Gomez, linux-perf-users,
linux-kernel
Cc: Leo Yan
If use command 'perf script -F,+data_src' to dump memory samples with
Arm SPE trace data, it reports error:
# perf script -F,+data_src
Samples for 'dummy:u' event do not have DATA_SRC attribute set. Cannot print 'data_src' field.
This is because the 'dummy:u' event is absent DATA_SRC bit in its sample
type, so if a file contains AUX area tracing data then always allow
field 'data_src' to be selected as an option for perf script.
Fixes: e55ed3423c1b ("perf arm-spe: Synthesize memory event")
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
tools/perf/builtin-script.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index a2f117936188..cf5eab5431b4 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -461,7 +461,7 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session)
return -EINVAL;
if (PRINT_FIELD(DATA_SRC) &&
- evsel__check_stype(evsel, PERF_SAMPLE_DATA_SRC, "DATA_SRC", PERF_OUTPUT_DATA_SRC))
+ evsel__do_check_stype(evsel, PERF_SAMPLE_DATA_SRC, "DATA_SRC", PERF_OUTPUT_DATA_SRC, allow_user_set))
return -EINVAL;
if (PRINT_FIELD(WEIGHT) &&
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] perf script: Always allow field 'data_src' for auxtrace
2022-04-17 11:48 [PATCH] perf script: Always allow field 'data_src' for auxtrace Leo Yan
@ 2022-04-18 14:45 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-04-18 14:45 UTC (permalink / raw)
To: Leo Yan
Cc: Adrian Hunter, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Namhyung Kim, James Clark,
German Gomez, linux-perf-users, linux-kernel
Em Sun, Apr 17, 2022 at 07:48:37PM +0800, Leo Yan escreveu:
> If use command 'perf script -F,+data_src' to dump memory samples with
> Arm SPE trace data, it reports error:
>
> # perf script -F,+data_src
> Samples for 'dummy:u' event do not have DATA_SRC attribute set. Cannot print 'data_src' field.
>
> This is because the 'dummy:u' event is absent DATA_SRC bit in its sample
> type, so if a file contains AUX area tracing data then always allow
> field 'data_src' to be selected as an option for perf script.
Thanks, applied to perf/urgent.
- Arnaldo
> Fixes: e55ed3423c1b ("perf arm-spe: Synthesize memory event")
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
> tools/perf/builtin-script.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
> index a2f117936188..cf5eab5431b4 100644
> --- a/tools/perf/builtin-script.c
> +++ b/tools/perf/builtin-script.c
> @@ -461,7 +461,7 @@ static int evsel__check_attr(struct evsel *evsel, struct perf_session *session)
> return -EINVAL;
>
> if (PRINT_FIELD(DATA_SRC) &&
> - evsel__check_stype(evsel, PERF_SAMPLE_DATA_SRC, "DATA_SRC", PERF_OUTPUT_DATA_SRC))
> + evsel__do_check_stype(evsel, PERF_SAMPLE_DATA_SRC, "DATA_SRC", PERF_OUTPUT_DATA_SRC, allow_user_set))
> return -EINVAL;
>
> if (PRINT_FIELD(WEIGHT) &&
> --
> 2.25.1
--
- Arnaldo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-18 15:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-17 11:48 [PATCH] perf script: Always allow field 'data_src' for auxtrace Leo Yan
2022-04-18 14:45 ` Arnaldo Carvalho de Melo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.