aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.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-annotate.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-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 2e418b9fc1c4..43e3bb354442 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -26,7 +26,6 @@
26#include "util/sort.h" 26#include "util/sort.h"
27#include "util/hist.h" 27#include "util/hist.h"
28#include "util/session.h" 28#include "util/session.h"
29#include "util/data_map.h"
30 29
31static char const *input_name = "perf.data"; 30static char const *input_name = "perf.data";
32 31
@@ -454,7 +453,7 @@ static void find_annotations(void)
454 } 453 }
455} 454}
456 455
457static struct perf_file_handler file_handler = { 456static struct perf_event_ops event_ops = {
458 .process_sample_event = process_sample_event, 457 .process_sample_event = process_sample_event,
459 .process_mmap_event = event__process_mmap, 458 .process_mmap_event = event__process_mmap,
460 .process_comm_event = event__process_comm, 459 .process_comm_event = event__process_comm,
@@ -463,7 +462,8 @@ static struct perf_file_handler file_handler = {
463 462
464static int __cmd_annotate(void) 463static int __cmd_annotate(void)
465{ 464{
466 struct perf_session *session = perf_session__new(input_name, O_RDONLY, force); 465 struct perf_session *session = perf_session__new(input_name, O_RDONLY,
466 force);
467 struct thread *idle; 467 struct thread *idle;
468 int ret; 468 int ret;
469 469
@@ -471,9 +471,9 @@ static int __cmd_annotate(void)
471 return -ENOMEM; 471 return -ENOMEM;
472 472
473 idle = register_idle_thread(); 473 idle = register_idle_thread();
474 register_perf_file_handler(&file_handler);
475 474
476 ret = perf_session__process_events(session, 0, &event__cwdlen, &event__cwd); 475 ret = perf_session__process_events(session, &event_ops, 0,
476 &event__cwdlen, &event__cwd);
477 if (ret) 477 if (ret)
478 goto out_delete; 478 goto out_delete;
479 479