Skip to contentSkip to conversation

perf evsel: display dmesg command of showing a hardcoded path

PATCH New Masum Reza 1 participant 1 message Sep 22, 2024 perf events

lore
Share & tools
lore

Masum Reza

author
#0 lore raw

PATCH 1/1 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.

---
 tools/perf/util/evsel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/evsel.c +1 -1
index bc603193c477..7a06b7cfdc7e 100644
@@ -3342,7 +3342,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));
 }
 
Signature · 1 line
2.46.0