public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf report: fix event name reporting
@ 2012-06-08 12:23 Dmitry Antipov
  2012-06-11  5:18 ` Namhyung Kim
  2012-06-11 14:14 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 5+ messages in thread
From: Dmitry Antipov @ 2012-06-08 12:23 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ingo Molnar, Paul Mackerras,
	Peter Zijlstra
  Cc: linux-kernel, linaro-dev, patches, Dmitry Antipov

Use trace_find_event to find event name before looking through
/sys files. This helps 'perf report' to show real event names
instead of 'unknown:unknown' when processing perf.data recorded
on another machine.

Signed-off-by: Dmitry Antipov <dmitry.antipov@linaro.org>
---
 tools/perf/builtin-report.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 8c767c6..a6fd309 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -24,6 +24,7 @@
 #include "util/evlist.h"
 #include "util/evsel.h"
 #include "util/header.h"
+#include "util/trace-event.h"
 #include "util/session.h"
 #include "util/tool.h"
 
@@ -314,7 +315,8 @@ static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,
 
 	list_for_each_entry(pos, &evlist->entries, node) {
 		struct hists *hists = &pos->hists;
-		const char *evname = event_name(pos);
+		struct event_format *event = trace_find_event(pos->attr.config);
+		const char *evname = event ? event->name : event_name(pos);
 
 		hists__fprintf_nr_sample_events(hists, evname, stdout);
 		hists__fprintf(hists, NULL, false, true, 0, 0, stdout);
-- 
1.7.7.6


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

end of thread, other threads:[~2012-06-12 14:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-08 12:23 [PATCH] perf report: fix event name reporting Dmitry Antipov
2012-06-11  5:18 ` Namhyung Kim
2012-06-11 14:14 ` Arnaldo Carvalho de Melo
2012-06-12  6:34   ` Namhyung Kim
2012-06-12 14:43     ` Arnaldo Carvalho de Melo

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