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-timechart.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-timechart.c')
-rw-r--r-- | tools/perf/builtin-timechart.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index a589a43112d6..b42f337c17d9 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c | |||
@@ -1029,23 +1029,12 @@ static void process_samples(struct perf_session *session) | |||
1029 | } | 1029 | } |
1030 | } | 1030 | } |
1031 | 1031 | ||
1032 | static int sample_type_check(struct perf_session *session) | ||
1033 | { | ||
1034 | if (!(session->sample_type & PERF_SAMPLE_RAW)) { | ||
1035 | fprintf(stderr, "No trace samples found in the file.\n" | ||
1036 | "Have you used 'perf timechart record' to record it?\n"); | ||
1037 | return -1; | ||
1038 | } | ||
1039 | |||
1040 | return 0; | ||
1041 | } | ||
1042 | |||
1043 | static struct perf_event_ops event_ops = { | 1032 | static struct perf_event_ops event_ops = { |
1044 | .process_comm_event = process_comm_event, | 1033 | .process_comm_event = process_comm_event, |
1045 | .process_fork_event = process_fork_event, | 1034 | .process_fork_event = process_fork_event, |
1046 | .process_exit_event = process_exit_event, | 1035 | .process_exit_event = process_exit_event, |
1047 | .process_sample_event = queue_sample_event, | 1036 | .process_sample_event = queue_sample_event, |
1048 | .sample_type_check = sample_type_check, | 1037 | .sample_type_check = perf_session__has_traces, |
1049 | }; | 1038 | }; |
1050 | 1039 | ||
1051 | static int __cmd_timechart(void) | 1040 | static int __cmd_timechart(void) |