mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-12-02 00:40:59 -05:00
perf record: Don't try to find buildids in a zero sized file
Fixing this symptom: [acme@mica linux-2.6-tip]$ perf record -a -f Fatal: Permission error - are you root? Bus error [acme@mica linux-2.6-tip]$ I.e. if for some reason no data is collected, in this case a non root user trying to do systemwide profiling, no data will be collected, and then we end up trying to mmap a zero sized file and access the file header, b00m. Reported-by: Ingo Molnar <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Frédéric Weisbecker <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: <[email protected]> LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
639fe4b12f
commit
9f591fd76a
1 changed files with 3 additions and 0 deletions
|
|
@ -395,6 +395,9 @@ static int process_buildids(void)
|
|||
{
|
||||
u64 size = lseek(output, 0, SEEK_CUR);
|
||||
|
||||
if (size == 0)
|
||||
return 0;
|
||||
|
||||
session->fd = output;
|
||||
return __perf_session__process_events(session, post_processing_offset,
|
||||
size - post_processing_offset,
|
||||
|
|
|
|||
Loading…
Reference in a new issue