Skip to content

Commit

Permalink
perf top: Add error message for EMFILE
Browse files Browse the repository at this point in the history
When a user tries to open so many events, perf_event_open syscall may
fail with EMFILE. Provide advise for that case.

Cc: Ingo Molnar <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
namhyung authored and acmel committed Jan 8, 2012
1 parent c30ab8a commit cdce445
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,10 @@ static void perf_top__start_counters(struct perf_top *top)
ui__warning("The %s event is not supported.\n",
event_name(counter));
goto out_err;
} else if (err == EMFILE) {
ui__warning("Too many events are opened.\n"
"Try again after reducing the number of events\n");
goto out_err;
}

ui__warning("The sys_perf_event_open() syscall "
Expand Down

0 comments on commit cdce445

Please sign in to comment.