From: Namhyung Kim Date: Sat, 7 Jan 2012 17:25:27 +0000 (+0900) Subject: perf top: Add error message for EMFILE X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cdce445906852d90efdc773ca7ba460e6e41664d;p=linux-beck.git 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 Cc: Paul Mackerras Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1325957132-10600-3-git-send-email-namhyung@gmail.com Signed-off-by: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo --- 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: 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 "