diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-10-06 16:26:02 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-10-06 16:34:13 -0300 |
commit | b0a7d1a0cd2e228dc06d099db2e1bb02f1b7d591 (patch) | |
tree | e943d42d36229261829b7c51978ecd1ee649a59a /tools/perf/builtin-top.c | |
parent | 0439539f72ea222fbfe511b47318b9c1815a7108 (diff) | |
download | lwn-b0a7d1a0cd2e228dc06d099db2e1bb02f1b7d591.tar.gz lwn-b0a7d1a0cd2e228dc06d099db2e1bb02f1b7d591.zip |
perf machine: Carve up event processing specific from perf_tool
The perf_tool vtable expects methods that receive perf_tool and
perf_sample entries, but for tools not interested in doing any special
processing on non PERF_RECORD_SAMPLE events, like 'perf top', and for
those not using perf_session, like 'perf trace', they were using
perf_event__process passing tool and sample paramenters that were just
not used.
Provide 'machine' methods for this purpose and make the perf_event
ones use them.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
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-ot9cc6mt025o8kbngzckcrx9@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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index ff6db8086805..fb9da71eba1f 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -26,6 +26,7 @@ #include "util/color.h" #include "util/evlist.h" #include "util/evsel.h" +#include "util/machine.h" #include "util/session.h" #include "util/symbol.h" #include "util/thread.h" @@ -871,7 +872,7 @@ static void perf_top__mmap_read_idx(struct perf_top *top, int idx) &sample, machine); } else if (event->header.type < PERF_RECORD_MAX) { hists__inc_nr_events(&evsel->hists, event->header.type); - perf_event__process(&top->tool, event, &sample, machine); + machine__process_event(machine, event); } else ++session->hists.stats.nr_unknown_events; } |