aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-11-25 05:19:45 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-11-28 07:38:56 -0500
commitd20deb64e0490ee9442b5181bc08a62d2cadcb90 (patch)
treeafdb3f6fc9abbce9d0a96b7049d1f8121178a356 /tools/perf/builtin-top.c
parent7009cc34b964939815160d7de64cf0215cdbf8bb (diff)
perf tools: Pass tool context in the the perf_event_ops functions
So that we don't need to have that many globals. Next steps will remove the 'session' pointer, that in most cases is not needed. Then we can rename perf_event_ops to 'perf_tool' that better describes this class hierarchy. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-wp4djox7x6w1i2bab1pt4xxp@git.kernel.org 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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 9b3bbb40d46f..e8e3320602bd 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -824,7 +824,7 @@ static void perf_session__mmap_read_idx(struct perf_session *self, int idx)
824 perf_event__process_sample(event, evsel, &sample, self); 824 perf_event__process_sample(event, evsel, &sample, self);
825 else if (event->header.type < PERF_RECORD_MAX) { 825 else if (event->header.type < PERF_RECORD_MAX) {
826 hists__inc_nr_events(&evsel->hists, event->header.type); 826 hists__inc_nr_events(&evsel->hists, event->header.type);
827 perf_event__process(event, &sample, self); 827 perf_event__process(&top.ops, event, &sample, self);
828 } else 828 } else
829 ++self->hists.stats.nr_unknown_events; 829 ++self->hists.stats.nr_unknown_events;
830 } 830 }
@@ -966,10 +966,10 @@ static int __cmd_top(void)
966 goto out_delete; 966 goto out_delete;
967 967
968 if (top.target_tid != -1) 968 if (top.target_tid != -1)
969 perf_event__synthesize_thread_map(top.evlist->threads, 969 perf_event__synthesize_thread_map(&top.ops, top.evlist->threads,
970 perf_event__process, top.session); 970 perf_event__process, top.session);
971 else 971 else
972 perf_event__synthesize_threads(perf_event__process, top.session); 972 perf_event__synthesize_threads(&top.ops, perf_event__process, top.session);
973 973
974 start_counters(top.evlist); 974 start_counters(top.evlist);
975 top.session->evlist = top.evlist; 975 top.session->evlist = top.evlist;