diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-28 13:20:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-28 13:20:25 -0500 |
commit | 6556a6743549defc32e5f90ee2cb1ecd833a44c3 (patch) | |
tree | 622306583d4a3c13235a8bfc012854c125c597f1 /tools/perf/builtin-timechart.c | |
parent | e0d272429a34ff143bfa04ee8e29dd4eed2964c7 (diff) | |
parent | 1dd2980d990068e20045b90c424518cc7f3657ff (diff) |
Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (172 commits)
perf_event, amd: Fix spinlock initialization
perf_event: Fix preempt warning in perf_clock()
perf tools: Flush maps on COMM events
perf_events, x86: Split PMU definitions into separate files
perf annotate: Handle samples not at objdump output addr boundaries
perf_events, x86: Remove superflous MSR writes
perf_events: Simplify code by removing cpu argument to hw_perf_group_sched_in()
perf_events, x86: AMD event scheduling
perf_events: Add new start/stop PMU callbacks
perf_events: Report the MMAP pgoff value in bytes
perf annotate: Defer allocating sym_priv->hist array
perf symbols: Improve debugging information about symtab origins
perf top: Use a macro instead of a constant variable
perf symbols: Check the right return variable
perf/scripts: Tag syscall_name helper as not yet available
perf/scripts: Add perf-trace-python Documentation
perf/scripts: Remove unnecessary PyTuple resizes
perf/scripts: Add syscall tracing scripts
perf/scripts: Add Python scripting engine
perf/scripts: Remove check-perf-trace from listed scripts
...
Fix trivial conflict in tools/perf/util/probe-event.c
Diffstat (limited to 'tools/perf/builtin-timechart.c')
-rw-r--r-- | tools/perf/builtin-timechart.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index 3f8bbcfb1e9b..0d4d8ff7914b 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c | |||
@@ -1029,33 +1029,24 @@ 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 | .comm = process_comm_event, |
1045 | .process_fork_event = process_fork_event, | 1034 | .fork = process_fork_event, |
1046 | .process_exit_event = process_exit_event, | 1035 | .exit = process_exit_event, |
1047 | .process_sample_event = queue_sample_event, | 1036 | .sample = queue_sample_event, |
1048 | .sample_type_check = sample_type_check, | ||
1049 | }; | 1037 | }; |
1050 | 1038 | ||
1051 | static int __cmd_timechart(void) | 1039 | static int __cmd_timechart(void) |
1052 | { | 1040 | { |
1053 | struct perf_session *session = perf_session__new(input_name, O_RDONLY, 0); | 1041 | struct perf_session *session = perf_session__new(input_name, O_RDONLY, 0); |
1054 | int ret; | 1042 | int ret = -EINVAL; |
1055 | 1043 | ||
1056 | if (session == NULL) | 1044 | if (session == NULL) |
1057 | return -ENOMEM; | 1045 | return -ENOMEM; |
1058 | 1046 | ||
1047 | if (!perf_session__has_traces(session, "timechart record")) | ||
1048 | goto out_delete; | ||
1049 | |||
1059 | ret = perf_session__process_events(session, &event_ops); | 1050 | ret = perf_session__process_events(session, &event_ops); |
1060 | if (ret) | 1051 | if (ret) |
1061 | goto out_delete; | 1052 | goto out_delete; |