diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-12-27 18:37:02 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-28 03:03:34 -0500 |
commit | d549c7690190d9739005e19604faad6da4b802ac (patch) | |
tree | 1a03376ecc41ecd9495298ed3ad34f72da7ecea0 /tools/perf/builtin-sched.c | |
parent | 27295592c22e71bbd38110c302da8dbb43912a60 (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-sched.c')
-rw-r--r-- | tools/perf/builtin-sched.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index d65098c42990..e862e71f4e68 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c | |||
@@ -1657,17 +1657,18 @@ static struct perf_event_ops event_ops = { | |||
1657 | .process_sample_event = process_sample_event, | 1657 | .process_sample_event = process_sample_event, |
1658 | .process_comm_event = event__process_comm, | 1658 | .process_comm_event = event__process_comm, |
1659 | .process_lost_event = process_lost_event, | 1659 | .process_lost_event = process_lost_event, |
1660 | .sample_type_check = perf_session__has_traces, | ||
1661 | }; | 1660 | }; |
1662 | 1661 | ||
1663 | static int read_events(void) | 1662 | static int read_events(void) |
1664 | { | 1663 | { |
1665 | int err; | 1664 | int err = -EINVAL; |
1666 | struct perf_session *session = perf_session__new(input_name, O_RDONLY, 0); | 1665 | struct perf_session *session = perf_session__new(input_name, O_RDONLY, 0); |
1667 | if (session == NULL) | 1666 | if (session == NULL) |
1668 | return -ENOMEM; | 1667 | return -ENOMEM; |
1669 | 1668 | ||
1670 | err = perf_session__process_events(session, &event_ops); | 1669 | if (perf_session__has_traces(session, "record -R")) |
1670 | err = perf_session__process_events(session, &event_ops); | ||
1671 | |||
1671 | perf_session__delete(session); | 1672 | perf_session__delete(session); |
1672 | return err; | 1673 | return err; |
1673 | } | 1674 | } |