lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Sun, 1 May 2016 00:37:41 -0700
From:	tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	hpa@...or.com, milian.wolff@...b.com, wangnan0@...wei.com,
	brendan.d.gregg@...il.com, acme@...hat.com, namhyung@...nel.org,
	tglx@...utronix.de, adrian.hunter@...el.com, dsahern@...il.com,
	mingo@...nel.org, fweisbec@...il.com, linux-kernel@...r.kernel.org,
	jolsa@...nel.org
Subject: [tip:perf/core] perf evsel: Handle ENOMEM for perf_event_max_stack
 + PERF_SAMPLE_CALLCHAIN

Commit-ID:  de46d5268c4ec5c5b473c96fbf56ece188a6ba85
Gitweb:     http://git.kernel.org/tip/de46d5268c4ec5c5b473c96fbf56ece188a6ba85
Author:     Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Wed, 27 Apr 2016 17:51:45 -0300
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Thu, 28 Apr 2016 09:58:58 -0300

perf evsel: Handle ENOMEM for perf_event_max_stack + PERF_SAMPLE_CALLCHAIN

When the kernel allows tweaking perf_event_max_stack and the event being
setup has PERF_SAMPLE_CALLCHAIN in its perf_event_attr.sample_type, tell
the user that tweaking /proc/sys/kernel/perf_event_max_stack may solve
the problem.

Before:

  # echo 32000 > /proc/sys/kernel/perf_event_max_stack
  # perf record -g usleep 1
  Error:
  The sys_perf_event_open() syscall returned with 12 (Cannot allocate memory) for event (cycles:ppp).
  /bin/dmesg may provide additional information.
  No CONFIG_PERF_EVENTS=y kernel support configured?

  #

After:

  # echo 64000 > /proc/sys/kernel/perf_event_max_stack
  # perf record -g usleep 1
  Error:
  Not enough memory to setup event with callchain.
  Hint: Try tweaking /proc/sys/kernel/perf_event_max_stack
  Hint: Current value: 64000
  #

Suggested-by: David Ahern <dsahern@...il.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Brendan Gregg <brendan.d.gregg@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Milian Wolff <milian.wolff@...b.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Wang Nan <wangnan0@...wei.com>
Link: http://lkml.kernel.org/n/tip-ebv0orelj1s1ye857vhb82ov@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/util/evsel.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 334364e2..9bed7f4 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2325,6 +2325,14 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target,
 			 "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 ENOMEM:
+		if ((evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN) != 0 &&
+		    access("/proc/sys/kernel/perf_event_max_stack", F_OK) == 0)
+			return scnprintf(msg, size,
+					 "Not enough memory to setup event with callchain.\n"
+					 "Hint: Try tweaking /proc/sys/kernel/perf_event_max_stack\n"
+					 "Hint: Current value: %d", sysctl_perf_event_max_stack);
+		break;
 	case ENODEV:
 		if (target->cpu_list)
 			return scnprintf(msg, size, "%s",

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ