mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/5] perf tools: Fix segfault when using -s trace_fields
@ 2016-01-05  3:03 Namhyung Kim
  2016-01-05  3:03 ` [PATCH 2/5] perf tools: Add all matching dynamic sort keys for field name Namhyung Kim
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Namhyung Kim @ 2016-01-05  3:03 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, Peter Zijlstra, Jiri Olsa, LKML, David Ahern,
	Steven Rostedt, Frederic Weisbecker, Andi Kleen, Wang Nan

When the 'trace_fields' sort key is used explicitly for non-tracepoint
events, it'll get segfault since it assumed evsel->tp_format was set.
Skip those events in add_all_dynamic_fields().

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/sort.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index e558e87cafaf..59c4c8586d79 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1955,6 +1955,9 @@ static int add_all_dynamic_fields(struct perf_evlist *evlist, bool raw_trace)
 	struct perf_evsel *evsel;
 
 	evlist__for_each(evlist, evsel) {
+		if (evsel->attr.type != PERF_TYPE_TRACEPOINT)
+			continue;
+
 		ret = add_evsel_fields(evsel, raw_trace);
 		if (ret < 0)
 			return ret;
-- 
2.6.4


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

end of thread, other threads:[~2016-01-05 10:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-05  3:03 [PATCH 1/5] perf tools: Fix segfault when using -s trace_fields Namhyung Kim
2016-01-05  3:03 ` [PATCH 2/5] perf tools: Add all matching dynamic sort keys for field name Namhyung Kim
2016-01-05  9:24   ` Jiri Olsa
2016-01-05 10:46     ` Namhyung Kim
2016-01-05  3:03 ` [PATCH 3/5] perf tools: Add document for dynamic sort keys Namhyung Kim
2016-01-05  9:26   ` Jiri Olsa
2016-01-05  3:03 ` [PATCH 4/5] perf tools: Support dynamic sort keys for -F/--fields Namhyung Kim
2016-01-05  9:30   ` Jiri Olsa
2016-01-05  3:03 ` [PATCH 5/5] perf evlist: Add -T/--trace option to show trace fields Namhyung Kim
2016-01-05  9:32   ` Jiri Olsa
2016-01-05  9:16 ` [PATCH 1/5] perf tools: Fix segfault when using -s trace_fields Jiri Olsa

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

Powered by JetHome