Skip to contentSkip to conversation

perf report tui: Improve multi event session support

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Mar 8, 2011 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  7f0030b211579939461468f25b80c73e293c46e0
Gitweb:     http://git.kernel.org/tip/7f0030b211579939461468f25b80c73e293c46e0
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Sun, 6 Mar 2011 13:07:30 -0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Sun, 6 Mar 2011 13:14:53 -0300

perf report tui: Improve multi event session support

When multiple events were used in 'perf record', allow the user to choose which one is wanted before showing the per event histograms.

Annotations will be performed on the chosen event.

Allow going back and forth from event to event quickly using just the arrow keys and enter.

Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Tom Zanussi <[email protected]>
Cc: William Cohen <[email protected]>
LKML-Reference: <new-submission>

---
 tools/perf/builtin-report.c         |    7 +-
 tools/perf/util/hist.h              |   16 +---
 tools/perf/util/ui/browsers/hists.c |  147 +++++++++++++++++++++++++++++++----
 3 files changed, 140 insertions(+), 30 deletions(-)
tools/perf/builtin-report.c +4 -3
index 1c399ea..e9b5d51 100644
@@ -222,7 +222,8 @@ static size_t hists__fprintf_nr_sample_events(struct hists *self,
 	return ret + fprintf(fp, "\n#\n");
 }
 
-static int hists__tty_browse_tree(struct perf_evlist *evlist, const char *help)
+static int perf_evlist__tty_browse_hists(struct perf_evlist *evlist,
+					 const char *help)
 {
 	struct perf_evsel *pos;
 
@@ -304,9 +305,9 @@ static int __cmd_report(void)
 	}
 
 	if (use_browser > 0)
-		hists__tui_browse_tree(session->evlist, help);
+		perf_evlist__tui_browse_hists(session->evlist, help);
 	else
-		hists__tty_browse_tree(session->evlist, help);
+		perf_evlist__tty_browse_hists(session->evlist, help);
 
 out_delete:
 	/*
tools/perf/util/hist.h +4 -12
index 0d38b43..cb6858a 100644
@@ -87,15 +87,9 @@ bool hists__new_col_len(struct hists *self, enum hist_column col, u16 len);
 struct perf_evlist;
 
 #ifdef NO_NEWT_SUPPORT
-static inline int hists__browse(struct hists *self __used,
-				const char *helpline __used,
-				const char *ev_name __used, int evidx __used)
-{
-	return 0;
-}
-
-static inline int hists__tui_browse_tree(struct perf_evlist *evlist __used,
-					 const char *help __used)
+static inline
+int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __used,
+				  const char *help __used)
 {
 	return 0;
 }
@@ -109,14 +103,12 @@ static inline int hist_entry__tui_annotate(struct hist_entry *self __used,
 #define KEY_RIGHT -2
 #else
 #include <newt.h>
-int hists__browse(struct hists *self, const char *helpline,
-		  const char *ev_name, int evidx);
 int hist_entry__tui_annotate(struct hist_entry *self, int evidx);
 
 #define KEY_LEFT NEWT_KEY_LEFT
 #define KEY_RIGHT NEWT_KEY_RIGHT
 
-int hists__tui_browse_tree(struct perf_evlist *evlist, const char *help);
+int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help);
 #endif
 
 unsigned int hists__sort_list_width(struct hists *self);
tools/perf/util/ui/browsers/hists.c +132 -15

195 lines not on this page · raw message