Commit 18ffdfe8 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

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>'
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1432587114-14924-1-git-send-email-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 84c2cafa
...@@ -2149,7 +2149,9 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target, ...@@ -2149,7 +2149,9 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target,
case EMFILE: case EMFILE:
return scnprintf(msg, size, "%s", return scnprintf(msg, size, "%s",
"Too many events are opened.\n" "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: case ENODEV:
if (target->cpu_list) if (target->cpu_list)
return scnprintf(msg, size, "%s", return scnprintf(msg, size, "%s",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment