diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-12-27 18:37:01 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-28 03:03:33 -0500 |
commit | 27295592c22e71bbd38110c302da8dbb43912a60 (patch) | |
tree | 01442f9b788e3b0a01bc29e22a0e799e1c45c91d /tools/perf/builtin-trace.c | |
parent | 4a58e61161074776aa34187ea369414ce4852394 (diff) |
perf session: Share the common trace sample_check routine as perf_session__has_traces
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-5-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.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 574a215e800b..b0ba2ac37e2c 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -103,22 +103,10 @@ static int process_sample_event(event_t *event, struct perf_session *session) | |||
103 | return 0; | 103 | return 0; |
104 | } | 104 | } |
105 | 105 | ||
106 | static int sample_type_check(struct perf_session *session) | ||
107 | { | ||
108 | if (!(session->sample_type & PERF_SAMPLE_RAW)) { | ||
109 | fprintf(stderr, | ||
110 | "No trace sample to read. Did you call perf record " | ||
111 | "without -R?"); | ||
112 | return -1; | ||
113 | } | ||
114 | |||
115 | return 0; | ||
116 | } | ||
117 | |||
118 | static struct perf_event_ops event_ops = { | 106 | static struct perf_event_ops event_ops = { |
119 | .process_sample_event = process_sample_event, | 107 | .process_sample_event = process_sample_event, |
120 | .process_comm_event = event__process_comm, | 108 | .process_comm_event = event__process_comm, |
121 | .sample_type_check = sample_type_check, | 109 | .sample_type_check = perf_session__has_traces, |
122 | }; | 110 | }; |
123 | 111 | ||
124 | static int __cmd_trace(struct perf_session *session) | 112 | static int __cmd_trace(struct perf_session *session) |