aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-trace.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-12-13 16:50:25 -0500
committerIngo Molnar <mingo@elte.hu>2009-12-14 10:57:15 -0500
commit301a0b020210360c6e441c7765521248bc87d58e (patch)
tree5321a8ab67584d0aac0e3df9a749df1b4206460b /tools/perf/builtin-trace.c
parentd8f66248d6f25f7c935cc5307c43bf394db07272 (diff)
perf session: Ditch register_perf_file_handler
Pass the event_ops to perf_session__process_events instead. Also move the event_ops definition to session.h, starting to move things around to their right place, trimming the many unneeded headers we have. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1260741029-4430-2-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r--tools/perf/builtin-trace.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 3057e1d387b9..c404dece950d 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -57,7 +57,6 @@ static int cleanup_scripting(void)
57#include "util/debug.h" 57#include "util/debug.h"
58 58
59#include "util/trace-event.h" 59#include "util/trace-event.h"
60#include "util/data_map.h"
61#include "util/exec_cmd.h" 60#include "util/exec_cmd.h"
62 61
63static char const *input_name = "perf.data"; 62static char const *input_name = "perf.data";
@@ -118,7 +117,7 @@ static int sample_type_check(u64 type)
118 return 0; 117 return 0;
119} 118}
120 119
121static struct perf_file_handler file_handler = { 120static struct perf_event_ops event_ops = {
122 .process_sample_event = process_sample_event, 121 .process_sample_event = process_sample_event,
123 .process_comm_event = event__process_comm, 122 .process_comm_event = event__process_comm,
124 .sample_type_check = sample_type_check, 123 .sample_type_check = sample_type_check,
@@ -127,9 +126,8 @@ static struct perf_file_handler file_handler = {
127static int __cmd_trace(struct perf_session *session) 126static int __cmd_trace(struct perf_session *session)
128{ 127{
129 register_idle_thread(); 128 register_idle_thread();
130 register_perf_file_handler(&file_handler); 129 return perf_session__process_events(session, &event_ops, 0,
131 130 &event__cwdlen, &event__cwd);
132 return perf_session__process_events(session, 0, &event__cwdlen, &event__cwd);
133} 131}
134 132
135struct script_spec { 133struct script_spec {