Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <masumrezarock100@gmail.com>
Cc: Yunseong Kim <yskelg@gmail.com>
Cc: Ze Gao <zegao2021@gmail.com>
Cc: Yang Jihong <yangjihong1@huawei.com>
Link: https://lore.kernel.org/r/20240922112619.149429-1-masumrezarock100@gmail.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Masum Reza and committed by
Namhyung Kim
f115506d eb0a59e9

+1 -1
+1 -1
tools/perf/util/evsel.c
··· 3415 3415 3416 3416 return scnprintf(msg, size, 3417 3417 "The sys_perf_event_open() syscall returned with %d (%s) for event (%s).\n" 3418 - "/bin/dmesg | grep -i perf may provide additional information.\n", 3418 + "\"dmesg | grep -i perf\" may provide additional information.\n", 3419 3419 err, str_error_r(err, sbuf, sizeof(sbuf)), evsel__name(evsel)); 3420 3420 } 3421 3421