Re: [PATCH 3/4] perf test probe_vfs_getname: Fix missing debuginfo detection

From: Namhyung Kim

Date: Thu Nov 05 2026 - 23:40:07 EST


On Thu, Nov 05, 2026 at 03:49:05PM +0000, James Clark wrote:
> skip_if_no_debuginfo() looks for the errors that 'perf probe' prints when
> there is no debuginfo in the output of add_probe_vfs_getname(). But since
> commit 92b664dcefab ("perf test probe_vfs_getname: Skip if no suitable
> line detected"), add_probe_vfs_getname() returns early without adding a
> probe if 'perf probe -L' doesn't find the line, which is also what
> happens when there is no debuginfo. The error from 'perf probe -L' is
> discarded, so the debuginfo errors are never found.
>
> This causes the debuginfo dependent subtests of the
> "perftool-testsuite_probe" test to fail instead of being skipped on
> kernels without debuginfo, because test_adding_kernel.sh calls
> skip_if_no_debuginfo() unconditionally. The other users only call it
> when add_probe_vfs_getname() returns 1, so they aren't affected.
>
> Fix it by doing a dry run of a probe that needs debuginfo instead. This
> works without libdw too, where 'perf probe -L' isn't available, and also
> avoids adding a real probe just to check for debuginfo. This fixes the
> "perftool-testsuite_probe" test:
>
> $ sudo perf test -vvv "perftool-testsuite_probe"
> ...
> -- [ FAIL ] -- perf_probe :: test_adding_kernel :: listing added probe :: perf probe -l (output regexp parsing)
> ...
> -- [ FAIL ] -- perf_probe :: test_adding_kernel :: wildcard adding support (command exitcode + output regexp parsing)
> ...
> -- [ FAIL ] -- perf_probe :: test_adding_kernel :: non-existing variable (output regexp parsing)
> ...
> ## [ FAIL ] ## perf_probe :: test_adding_kernel SUMMARY :: 3 failures found
> ...
> 189: perftool-testsuite_probe : FAILED!
>
> Fixes: 92b664dcefab ("perf test probe_vfs_getname: Skip if no suitable line detected")
> Signed-off-by: James Clark <james.clark@xxxxxxxxxx>
> ---
> tools/perf/tests/shell/lib/probe_vfs_getname.sh | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/tests/shell/lib/probe_vfs_getname.sh b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> index 57a59ae7d4ae..1c3af5771bcf 100644
> --- a/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> +++ b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> @@ -64,7 +64,8 @@ add_probe_vfs_getname() {
> }
>
> skip_if_no_debuginfo() {
> - add_probe_vfs_getname -v 2>&1 | grep -E -q "^(Failed to find the path for the kernel|Debuginfo-analysis is not supported)|(file has no debug information)" && return 2
> + # Dry run a probe that needs debuginfo.
> + perf probe -n -v 'getname_flags $params' 2>&1 | grep -E -q "^(Failed to find the path for the kernel|Debuginfo-analysis is not supported)|(file has no debug information)" && return 2

Nit: can we break the long line like this?

perf probe -nv 'getname_flags $params' 2>&1 | grep -q \
-e "Failed to find the path for the kernel" \
-e "Debuginfo-analysis is not supported" \
-e "file has no debug information" && return 2

Thanks,
Namhyung


> return 1
> }
>
>
> --
> 2.43.0
>