lkml.org 
[lkml]   [2012]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/8] perf top: Add error message for EMFILE
Date
When a user tries to open so many events, perf_event_open syscall
may fail with EMFILE. Provide advise for that case.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
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 4f81eeb99875..ad18dd37e87d 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -889,6 +889,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 "
--
1.7.6


\
 
 \ /
  Last update: 2012-01-07 18:29    [W:0.046 / U:19.912 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site