aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/ui
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-03-05 19:40:06 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-03-06 11:13:40 -0500
commite248de331a452f8771eda6ed4bb30d92c82df28b (patch)
tree7ef04743a7bf7a1da354a3b82536ef32504823d9 /tools/perf/util/ui
parent3d3b5e95997208067c963923db90ed1517565d14 (diff)
perf tools: Improve support for sessions with multiple events
By creating an perf_evlist out of the attributes in the perf.data file header, so that we can use evlists and evsels when reading recorded sessions in addition to when we record sessions. More work is needed to allow tools to allow the user to select which events are wanted when browsing sessions, be it just one or a subset of them, aggregated or showed at the same time but with different indications on the UI to allow seeing workloads thru different views at the same time. But the overall goal/trend is to more uniformly use evsels and evlists. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/ui')
-rw-r--r--tools/perf/util/ui/browsers/hists.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c
index c98e6f81d285..f3af4fe5cdc4 100644
--- a/tools/perf/util/ui/browsers/hists.c
+++ b/tools/perf/util/ui/browsers/hists.c
@@ -7,6 +7,8 @@
7#include <newt.h> 7#include <newt.h>
8#include <linux/rbtree.h> 8#include <linux/rbtree.h>
9 9
10#include "../../evsel.h"
11#include "../../evlist.h"
10#include "../../hist.h" 12#include "../../hist.h"
11#include "../../pstack.h" 13#include "../../pstack.h"
12#include "../../sort.h" 14#include "../../sort.h"
@@ -987,31 +989,33 @@ out:
987 return key; 989 return key;
988} 990}
989 991
990int hists__tui_browse_tree(struct rb_root *self, const char *help, int evidx) 992int hists__tui_browse_tree(struct perf_evlist *evlist, const char *help)
991{ 993{
992 struct rb_node *first = rb_first(self), *nd = first, *next; 994 struct perf_evsel *pos;
993 int key = 0;
994 995
995 while (nd) { 996 pos = list_entry(evlist->entries.next, struct perf_evsel, node);
996 struct hists *hists = rb_entry(nd, struct hists, rb_node); 997 while (pos) {
997 const char *ev_name = __event_name(hists->type, hists->config); 998 struct hists *hists = &pos->hists;
999 const char *ev_name = event_name(pos);
1000 int key = hists__browse(hists, help, ev_name, pos->idx);
998 1001
999 key = hists__browse(hists, help, ev_name, evidx);
1000 switch (key) { 1002 switch (key) {
1001 case NEWT_KEY_TAB: 1003 case NEWT_KEY_TAB:
1002 next = rb_next(nd); 1004 if (pos->node.next == &evlist->entries)
1003 if (next) 1005 pos = list_entry(evlist->entries.next, struct perf_evsel, node);
1004 nd = next; 1006 else
1007 pos = list_entry(pos->node.next, struct perf_evsel, node);
1005 break; 1008 break;
1006 case NEWT_KEY_UNTAB: 1009 case NEWT_KEY_UNTAB:
1007 if (nd == first) 1010 if (pos->node.prev == &evlist->entries)
1008 continue; 1011 pos = list_entry(evlist->entries.prev, struct perf_evsel, node);
1009 nd = rb_prev(nd); 1012 else
1013 pos = list_entry(pos->node.prev, struct perf_evsel, node);
1010 break; 1014 break;
1011 default: 1015 default:
1012 return key; 1016 return key;
1013 } 1017 }
1014 } 1018 }
1015 1019
1016 return key; 1020 return 0;
1017} 1021}