Skip to contentSkip to conversation

perf tools: Add hint for 'Too many events are opened.' error message

PATCH Applied Jiri Olsa 3 participants 3 messages May 25, 2015 – May 28, 2015 perf events

lore
Share & tools
lore

Jiri Olsa

author reviewer
#0 lore raw

PATCH 1/1 perf tools: Add hint for 'Too many events are opened.' error message

Enhancing the 'Too many events are opened.' error message with hint to use use 'ulimit -n <limit>' command.

Before:

  $ perf record -e 'sched:*,syscalls:*' ls
  Error:
  Too many events are opened.
  Try again after reducing the number of events.

Now:

  $ perf record -e 'sched:*,syscalls:*' ls
  Error:
  Too many events are opened.
  Probably the maximum number of open file descriptors has been reached.
  Hint: Try again after reducing the number of events.
  Hint: Try increasing the limit with 'ulimit -n <limit>'
---
 tools/perf/util/evsel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/util/evsel.c +3 -1
index c886b9f7a48d..a3e36fc634dc 100644
@@ -2149,7 +2149,9 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target,
 	case EMFILE:
 		return scnprintf(msg, size, "%s",
 			 "Too many events are opened.\n"
-			 "Try again after reducing the number of events.");
+			 "Probably the maximum number of open file descriptors has been reached.\n"
+			 "Hint: Try again after reducing the number of events.\n"
+			 "Hint: Try increasing the limit with 'ulimit -n <limit>'");
 	case ENODEV:
 		if (target->cpu_list)
 			return scnprintf(msg, size, "%s",
Signature · 1 line
1.9.3
maintainer Applied
#1 lore raw

Em Mon, May 25, 2015 at 10:51:54PM +0200, Jiri Olsa escreveu:

Quoted 2 lines

Enhancing the 'Too many events are opened.' error message with hint to use use 'ulimit -n <limit>' command.

<SNIP>

Quoted 7 lines

Now:

  $ perf record -e 'sched:*,syscalls:*' ls
  Error:
  Too many events are opened.
  Probably the maximum number of open file descriptors has been reached.
  Hint: Try again after reducing the number of events.
  Hint: Try increasing the limit with 'ulimit -n <limit>'

Thanks, applied.

- Arnaldo

#2 lore raw

[tip:perf/core] perf tools: Add hint for ' Too many events are opened.' error message

In reply to Jiri Olsa
perf tools: Add hint for 'Too many events are opened.' error message
Commit-ID:  18ffdfe8e98f861a39590ef2374ad51fc963567e
Gitweb:     http://git.kernel.org/tip/18ffdfe8e98f861a39590ef2374ad51fc963567e
Author:     Jiri Olsa <[email protected]>
AuthorDate: Mon, 25 May 2015 22:51:54 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 27 May 2015 20:28:37 -0300

perf tools: Add hint for 'Too many events are opened.' error message

Enhancing the 'Too many events are opened.' error message with hint to use use 'ulimit -n <limit>' command.

Before:

  $ perf record -e 'sched:*,syscalls:*' ls
  Error:
  Too many events are opened.
  Try again after reducing the number of events.

Now:

  $ perf record -e 'sched:*,syscalls:*' ls
  Error:
  Too many events are opened.
  Probably the maximum number of open file descriptors has been reached.
  Hint: Try again after reducing the number of events.
  Hint: Try increasing the limit with 'ulimit -n <limit>'
---
 tools/perf/util/evsel.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tools/perf/util/evsel.c +3 -1
index c886b9f..a3e36fc 100644
@@ -2149,7 +2149,9 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target,
 	case EMFILE:
 		return scnprintf(msg, size, "%s",
 			 "Too many events are opened.\n"
-			 "Try again after reducing the number of events.");
+			 "Probably the maximum number of open file descriptors has been reached.\n"
+			 "Hint: Try again after reducing the number of events.\n"
+			 "Hint: Try increasing the limit with 'ulimit -n <limit>'");
 	case ENODEV:
 		if (target->cpu_list)
 			return scnprintf(msg, size, "%s",