linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf script: Skip dummy event attr check
@ 2022-08-31 12:40 Jiri Olsa
  2022-08-31 16:02 ` Ian Rogers
  0 siblings, 1 reply; 10+ messages in thread
From: Jiri Olsa @ 2022-08-31 12:40 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Hongtao Yu, Namhyung Kim, lkml, Peter Zijlstra, Ingo Molnar,
	Mark Rutland, Alexander Shishkin, Ian Rogers, linux-perf-users

Hongtao Yu reported problem when displaying uregs in perf script
for system wide perf.data:

  # perf script -F uregs | head -10
  Samples for 'dummy:HG' event do not have UREGS attribute set. Cannot print 'uregs' field.

The problem is the extra dummy event added for system wide,
which does not have proper sample_type setup.

Skipping attr check completely for dummy event as suggested
by Namhyung, because it does not have any samples anyway.

Reported-by: Hongtao Yu <hoy@fb.com>
Suggested-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/builtin-script.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 13580a9c50b8..304d234d8e84 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -566,6 +566,8 @@ static struct evsel *find_first_output_type(struct evlist *evlist,
 	struct evsel *evsel;
 
 	evlist__for_each_entry(evlist, evsel) {
+		if (evsel__is_dummy_event(evsel))
+			continue;
 		if (output_type(evsel->core.attr.type) == (int)type)
 			return evsel;
 	}
-- 
2.37.2


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

end of thread, other threads:[~2022-09-08  6:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-31 12:40 [PATCH] perf script: Skip dummy event attr check Jiri Olsa
2022-08-31 16:02 ` Ian Rogers
2022-08-31 16:23   ` Arnaldo Carvalho de Melo
2022-09-07  2:49     ` Xing Zhengjun
2022-09-07  4:50       ` Namhyung Kim
2022-09-07  5:19         ` Xing Zhengjun
2022-09-07  8:09           ` Jiri Olsa
2022-09-07  8:14             ` Namhyung Kim
2022-09-07 14:16               ` Jiri Olsa
2022-09-08  6:56                 ` Xing Zhengjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).