linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@gmail.com>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/8] perf top: Add error message for EMFILE
Date: Sun,  8 Jan 2012 02:25:27 +0900	[thread overview]
Message-ID: <1325957132-10600-3-git-send-email-namhyung@gmail.com> (raw)
In-Reply-To: <1325957132-10600-1-git-send-email-namhyung@gmail.com>

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


  parent reply	other threads:[~2012-01-07 17:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-07 17:25 [PATCH 1/8] perf script: Add missing closedir() calls Namhyung Kim
2012-01-07 17:25 ` [PATCH 2/8] perf test: Change type of '-v' option to INCR Namhyung Kim
2012-01-09  7:23   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-01-07 17:25 ` Namhyung Kim [this message]
2012-01-09  7:24   ` [tip:perf/core] perf top: Add error message for EMFILE tip-bot for Namhyung Kim
2012-01-07 17:25 ` [PATCH 4/8] perf kmem: Add missing closedir() calls Namhyung Kim
2012-01-09  7:25   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-01-07 17:25 ` [PATCH 5/8] perf kmem: Fix a memory leak Namhyung Kim
2012-01-09  7:26   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-01-07 17:25 ` [PATCH 6/8] perf annotate: Fix usage string Namhyung Kim
2012-01-09  7:26   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-01-07 17:25 ` [PATCH 7/8] perf annotate: Get rid of field_sep check Namhyung Kim
2012-01-09  7:27   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-01-07 17:25 ` [PATCH 8/8] perf report: Fix --stdio output alignment when --showcpuutilization used Namhyung Kim
2012-01-09  7:28   ` [tip:perf/core] " tip-bot for Namhyung Kim
2012-01-09  7:23 ` [tip:perf/core] perf script: Add missing closedir() calls tip-bot for Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1325957132-10600-3-git-send-email-namhyung@gmail.com \
    --to=namhyung@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).