From: Peter Zijlstra Date: Fri, 1 May 2009 10:23:18 +0000 (+0200) Subject: perf_counter: tool: handle 0-length data files X-Git-Tag: v2.6.31-rc1~383^2~315 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=585e3374d9d29376c2c37d821c8b7637dd48ca95;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Cc: Paul Mackerras Cc: Corey Ashford LKML-Reference: <20090501102533.196245693@chello.nl> Signed-off-by: Ingo Molnar --- diff --git a/Documentation/perf_counter/perf-report.cc b/Documentation/perf_counter/perf-report.cc index 933a075..911d7f3 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: