Skip to content

Commit

Permalink
perf_counter: tool: handle 0-length data files
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed May 1, 2009
1 parent 63a809a commit 585e337
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Documentation/perf_counter/perf-report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 585e337

Please sign in to comment.