aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-trace.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-12-27 18:37:02 -0500
committerIngo Molnar <mingo@elte.hu>2009-12-28 03:03:34 -0500
commitd549c7690190d9739005e19604faad6da4b802ac (patch)
tree1a03376ecc41ecd9495298ed3ad34f72da7ecea0 /tools/perf/builtin-trace.c
parent27295592c22e71bbd38110c302da8dbb43912a60 (diff)
perf session: Remove sample_type_check from event_ops
This is really something tools need to do before asking for the events to be processed, leaving perf_session__process_events to do just that, process events. Also add a msg parameter to perf_session__has_traces() so that the right message can be printed, fixing a regression added by me in the previous cset (right timechart message) and also fixing 'perf kmem', that was not asking if 'perf kmem record' was ran. 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: <1261957026-15580-6-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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index b0ba2ac37e2c..e94f34631585 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -106,7 +106,6 @@ static int process_sample_event(event_t *event, struct perf_session *session)
106static struct perf_event_ops event_ops = { 106static struct perf_event_ops event_ops = {
107 .process_sample_event = process_sample_event, 107 .process_sample_event = process_sample_event,
108 .process_comm_event = event__process_comm, 108 .process_comm_event = event__process_comm,
109 .sample_type_check = perf_session__has_traces,
110}; 109};
111 110
112static int __cmd_trace(struct perf_session *session) 111static int __cmd_trace(struct perf_session *session)
@@ -580,6 +579,9 @@ int cmd_trace(int argc, const char **argv, const char *prefix __used)
580 if (session == NULL) 579 if (session == NULL)
581 return -ENOMEM; 580 return -ENOMEM;
582 581
582 if (!perf_session__has_traces(session, "record -R"))
583 return -EINVAL;
584
583 if (generate_script_lang) { 585 if (generate_script_lang) {
584 struct stat perf_stat; 586 struct stat perf_stat;
585 587