From f115506d2ce4549df306746cd0b1c5d7bf6537f5 Mon Sep 17 00:00:00 2001 From: Masum Reza Date: Sun, 22 Sep 2024 16:56:16 +0530 Subject: [PATCH] perf evsel: display dmesg command of showing a hardcoded path In non-FHS compliant distros like NixOS, nothing resides in `/bin` and `/usr/bin`. Instead dynamically symlinked into `/run/current-system/sw/bin/`, the executable resides in `/nix/store`. With this patch,`/bin` prefix from the dmesg command in the error message is stripped. Link: https://github.com/NixOS/nixpkgs/pull/258027 Signed-off-by: Masum Reza Cc: Yunseong Kim Cc: Ze Gao Cc: Yang Jihong Link: https://lore.kernel.org/r/20240922112619.149429-1-masumrezarock100@gmail.com Signed-off-by: Namhyung Kim --- tools/perf/util/evsel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index dbf9c8cee3c56..b9c18f3316997 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -3415,7 +3415,7 @@ int evsel__open_strerror(struct evsel *evsel, struct target *target, return scnprintf(msg, size, "The sys_perf_event_open() syscall returned with %d (%s) for event (%s).\n" - "/bin/dmesg | grep -i perf may provide additional information.\n", + "\"dmesg | grep -i perf\" may provide additional information.\n", err, str_error_r(err, sbuf, sizeof(sbuf)), evsel__name(evsel)); }