diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-05-27 16:13:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-27 16:19:58 -0400 |
commit | 55717314c4e3a5180a54228a2f97e50f3496de4c (patch) | |
tree | 14c49455a28011e8122bfdec48162363a2090bbd /Documentation/perf_counter | |
parent | 2d65537ee7cd4a0818ea80a97ab7932368fff5cd (diff) |
pref_counter: tools: report: Robustify in case of weird events
This error condition:
aldebaran:~/linux/linux/Documentation/perf_counter> perf report
dso__load_sym: cannot get elf header.
failed to open: /etc/ld.so.cache
problem processing PERF_EVENT_MMAP, bailing out
caused the profile to be very short - as the error was at the beginning
of the file and we bailed out completely.
Be more permissive and consider the event broken instead.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'Documentation/perf_counter')
-rw-r--r-- | Documentation/perf_counter/builtin-report.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/Documentation/perf_counter/builtin-report.c b/Documentation/perf_counter/builtin-report.c index 6df95c2698c6..5993c129d736 100644 --- a/Documentation/perf_counter/builtin-report.c +++ b/Documentation/perf_counter/builtin-report.c | |||
@@ -1117,9 +1117,9 @@ more: | |||
1117 | } | 1117 | } |
1118 | 1118 | ||
1119 | if (thread == NULL) { | 1119 | if (thread == NULL) { |
1120 | fprintf(stderr, "problem processing %d event, bailing out\n", | 1120 | fprintf(stderr, "problem processing %d event, skipping it.\n", |
1121 | event->header.type); | 1121 | event->header.type); |
1122 | goto done; | 1122 | goto broken_event; |
1123 | } | 1123 | } |
1124 | 1124 | ||
1125 | if (event->header.misc & PERF_EVENT_MISC_KERNEL) { | 1125 | if (event->header.misc & PERF_EVENT_MISC_KERNEL) { |
@@ -1149,8 +1149,8 @@ more: | |||
1149 | 1149 | ||
1150 | if (hist_entry__add(thread, map, dso, sym, ip, level)) { | 1150 | if (hist_entry__add(thread, map, dso, sym, ip, level)) { |
1151 | fprintf(stderr, | 1151 | fprintf(stderr, |
1152 | "problem incrementing symbol count, bailing out\n"); | 1152 | "problem incrementing symbol count, skipping event\n"); |
1153 | goto done; | 1153 | goto broken_event; |
1154 | } | 1154 | } |
1155 | } | 1155 | } |
1156 | total++; | 1156 | total++; |
@@ -1169,8 +1169,8 @@ more: | |||
1169 | event->mmap.filename); | 1169 | event->mmap.filename); |
1170 | } | 1170 | } |
1171 | if (thread == NULL || map == NULL) { | 1171 | if (thread == NULL || map == NULL) { |
1172 | fprintf(stderr, "problem processing PERF_EVENT_MMAP, bailing out\n"); | 1172 | fprintf(stderr, "problem processing PERF_EVENT_MMAP, skipping event.\n"); |
1173 | goto done; | 1173 | goto broken_event; |
1174 | } | 1174 | } |
1175 | thread__insert_map(thread, map); | 1175 | thread__insert_map(thread, map); |
1176 | total_mmap++; | 1176 | total_mmap++; |
@@ -1187,8 +1187,8 @@ more: | |||
1187 | } | 1187 | } |
1188 | if (thread == NULL || | 1188 | if (thread == NULL || |
1189 | thread__set_comm(thread, event->comm.comm)) { | 1189 | thread__set_comm(thread, event->comm.comm)) { |
1190 | fprintf(stderr, "problem processing PERF_EVENT_COMM, bailing out\n"); | 1190 | fprintf(stderr, "problem processing PERF_EVENT_COMM, skipping event.\n"); |
1191 | goto done; | 1191 | goto broken_event; |
1192 | } | 1192 | } |
1193 | total_comm++; | 1193 | total_comm++; |
1194 | break; | 1194 | break; |
@@ -1221,7 +1221,6 @@ broken_event: | |||
1221 | goto more; | 1221 | goto more; |
1222 | 1222 | ||
1223 | rc = EXIT_SUCCESS; | 1223 | rc = EXIT_SUCCESS; |
1224 | done: | ||
1225 | close(input); | 1224 | close(input); |
1226 | 1225 | ||
1227 | if (dump_trace) { | 1226 | if (dump_trace) { |