summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-05-01 14:23:18 +0400
committerIngo Molnar <mingo@elte.hu>2009-05-01 15:23:44 +0400
commit585e3374d9d29376c2c37d821c8b7637dd48ca95 (patch)
tree475ce31aa831f186ddb8416a29548996a8ded2cf
parent63a809a2dc53b91268dd915bbcbd425063893676 (diff)
downloadlinux-585e3374d9d29376c2c37d821c8b7637dd48ca95.tar.xz
perf_counter: tool: handle 0-length data files
Avoid perf-report barfing on 0-length data files. [ Impact: fix perf-report SIGBUS ] Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> LKML-Reference: <20090501102533.196245693@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--Documentation/perf_counter/perf-report.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/Documentation/perf_counter/perf-report.cc b/Documentation/perf_counter/perf-report.cc
index 933a07544534..911d7f3e7a65 100644
--- a/Documentation/perf_counter/perf-report.cc
+++ b/Documentation/perf_counter/perf-report.cc
@@ -402,6 +402,11 @@ int main(int argc, char *argv[])
exit(-1);
}
+ if (!stat.st_size) {
+ fprintf(stderr, "zero-sized file, nothing to do!\n");
+ exit(0);
+ }
+
load_kallsyms();
remap: