diff options
author | Namhyung Kim <namhyung@gmail.com> | 2012-01-07 12:25:27 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-01-08 10:26:11 -0500 |
commit | cdce445906852d90efdc773ca7ba460e6e41664d (patch) | |
tree | b09c6c99908c573f4c72cf1c30e5078eb0413c96 /tools/perf | |
parent | c30ab8aa084843159b4679e9a3d7f63187d5906a (diff) |
perf top: Add error message for EMFILE
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 <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1325957132-10600-3-git-send-email-namhyung@gmail.com
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-top.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index d89dec90103e..8f80df896038 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -888,6 +888,10 @@ try_again: | |||
888 | ui__warning("The %s event is not supported.\n", | 888 | ui__warning("The %s event is not supported.\n", |
889 | event_name(counter)); | 889 | event_name(counter)); |
890 | goto out_err; | 890 | goto out_err; |
891 | } else if (err == EMFILE) { | ||
892 | ui__warning("Too many events are opened.\n" | ||
893 | "Try again after reducing the number of events\n"); | ||
894 | goto out_err; | ||
891 | } | 895 | } |
892 | 896 | ||
893 | ui__warning("The sys_perf_event_open() syscall " | 897 | ui__warning("The sys_perf_event_open() syscall " |