Re: [PATCH v3 3/4] perf test probe_vfs_getname: Fix missing debuginfo detection
From: Namhyung Kim
Date: Mon Nov 09 2026 - 21:52:09 EST
On Mon, Nov 09, 2026 at 12:11:09PM +0000, James Clark wrote:
>
>
> On 09/11/2026 10:17, 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 | 6 +++++-
> > 1 file changed, 5 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..98cfb02cf7c6 100644
> > --- a/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> > +++ b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> > @@ -64,7 +64,11 @@ 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 -q \
> > + -e "^Failed to find the path for the kernel" \
> > + -e "^Debuginfo-analysis is not supported" \
> > + -e "file has no debug information" && return 2
> > return 1
> > }
> >
>
> Hi Namhyung,
>
> This patch causes a shellcheck issue with certain versions. Not sure if you
> applied it already, but I'll send another version anyway:
>
> In tests/shell/./lib/probe_vfs_getname.sh line 30:
> add_probe_vfs_getname() {
> ^-- SC2120 (warning): add_probe_vfs_getname references arguments, but none
> are ever passed.
No worries, I'll pick v4.
Thanks,
Namhyung