aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-03-10 09:15:54 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-03-10 09:15:54 -0500
commita91e5431d54f5359fccb5ec2512f252eb217707e (patch)
tree8f8ba4940d9f4e910b339baee13a710baa920378 /tools/perf/builtin-top.c
parent6547250381eb315acff3d52b4872ad775359407c (diff)
perf session: Use evlist/evsel for managing perf.data attributes
So that we can reuse things like the id to attr lookup routine (perf_evlist__id2evsel) that uses a hash table instead of the linear lookup done in the older perf_header_attr routines, etc. Also to make evsels/evlist more pervasive an API, simplyfing using the emerging perf lib. cc: Arun Sharma <arun@sharma-home.net> 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/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 417f757e3cbe..80c9e062bd5b 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -883,7 +883,6 @@ try_again:
883static int __cmd_top(void) 883static int __cmd_top(void)
884{ 884{
885 pthread_t thread; 885 pthread_t thread;
886 struct perf_evsel *first;
887 int ret __used; 886 int ret __used;
888 /* 887 /*
889 * FIXME: perf_session__new should allow passing a O_MMAP, so that all this 888 * FIXME: perf_session__new should allow passing a O_MMAP, so that all this
@@ -900,8 +899,8 @@ static int __cmd_top(void)
900 perf_event__synthesize_threads(perf_event__process, session); 899 perf_event__synthesize_threads(perf_event__process, session);
901 900
902 start_counters(top.evlist); 901 start_counters(top.evlist);
903 first = list_entry(top.evlist->entries.next, struct perf_evsel, node); 902 session->evlist = top.evlist;
904 perf_session__set_sample_type(session, first->attr.sample_type); 903 perf_session__update_sample_type(session);
905 904
906 /* Wait for a minimal set of events before starting the snapshot */ 905 /* Wait for a minimal set of events before starting the snapshot */
907 poll(top.evlist->pollfd, top.evlist->nr_fds, 100); 906 poll(top.evlist->pollfd, top.evlist->nr_fds, 100);