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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 23 Feb 2021 16:25:35 +0800
From:   He Zhe <zhe.he@...driver.com>
To:     catalin.marinas@....com, will@...nel.org, mark.rutland@....com,
        alexander.shishkin@...ux.intel.com, jolsa@...hat.com,
        namhyung@...nel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] perf tools: Improve EOPNOTSUPP error reporting

There may be multiple reasons for EOPNOTSUPP. Sometimes we cannot determine
which one it is.

For example, when we set up uprobe with 32-bit perf and arm64 kernel on
some hardware that does not support sampling/overflow-interrupts,
$ perf probe -x /lib/libc.so.6 malloc
$ perf record -e probe_libc:malloc -a ls

Before this patch:
probe_libc:malloc: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'

After this patch:
probe_libc:malloc: PMU Hardware may not support sampling/overflow-interrupts. Try 'perf stat'.
Some 64-bit architectures may not support 32-bit instruction probing.

Signed-off-by: He Zhe <zhe.he@...driver.com>
---
 tools/perf/util/evsel.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 1bf76864c4f2..aa56511ddf60 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2697,22 +2697,24 @@ int evsel__open_strerror(struct evsel *evsel, struct target *target,
 		break;
 	case EOPNOTSUPP:
 		if (evsel->core.attr.aux_output)
-			return scnprintf(msg, size,
-	"%s: PMU Hardware doesn't support 'aux_output' feature",
+			printed += scnprintf(msg + printed, size,
+	"%s: PMU Hardware may not support 'aux_output' feature.\n",
 					 evsel__name(evsel));
 		if (evsel->core.attr.sample_period != 0)
-			return scnprintf(msg, size,
-	"%s: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'",
+			printed += scnprintf(msg + printed, size,
+	"%s: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'.\n",
 					 evsel__name(evsel));
 		if (evsel->core.attr.precise_ip)
-			return scnprintf(msg, size, "%s",
-	"\'precise\' request may not be supported. Try removing 'p' modifier.");
+			printed += scnprintf(msg + printed, size, "%s",
+	"\'precise\' request may not be supported. Try removing 'p' modifier.\n");
 #if defined(__i386__) || defined(__x86_64__)
 		if (evsel->core.attr.type == PERF_TYPE_HARDWARE)
-			return scnprintf(msg, size, "%s",
+			printed += scnprintf(msg + printed, size, "%s",
 	"No hardware sampling interrupt available.\n");
 #endif
-		break;
+		scnprintf(msg + printed, size, "%s",
+	"Some 64-bit architectures may not support 32-bit instruction uprobe.\n");
+		return;
 	case EBUSY:
 		if (find_process("oprofiled"))
 			return scnprintf(msg, size,
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ