Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Namhyung Kim" <namhyung@kernel.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf test: Fix perf probe testsuite
Date: Thu, 05 Nov 2026 07:37:06 +0000	[thread overview]
Message-ID: <sashiko-outbox-198684@kernel.org> (raw)
In-Reply-To: <20261105071711.31086-1-namhyung@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] perf test: skip_if_no_debuginfo() falsely skips tests when debuginfo is present
--

commit c8d75c8c4279c6a4cb8737397d31f026d6424692
Author: Namhyung Kim <namhyung@kernel.org>

perf test: Fix perf probe testsuite

This commit updates skip_if_no_debuginfo() in
tools/perf/tests/shell/lib/probe_vfs_getname.sh to match the "Could not find
probeable line" message emitted by add_probe_vfs_getname() when checking
whether kernel debuginfo is available.

> diff --git a/tools/perf/tests/shell/lib/probe_vfs_getname.sh b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> index 88cd0e26d5f67..3a78f1d6eb165 100644
> --- a/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> +++ b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
> @@ -39,7 +39,7 @@ 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
> +	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|Could not find probeable line)" && return 2

[Severity: Medium]
Does matching "Could not find probeable line" here cause
skip_if_no_debuginfo() to report missing debuginfo even when full kernel
debuginfo is present?

In tools/perf/tests/shell/lib/probe_vfs_getname.sh, add_probe_vfs_getname()
pipes stderr from perf probe -L getname_flags into grep when searching for
source lines matching initname, result->uptr, or result->aname:

    result_initname_re="[[:space:]]+([[:digit:]]+)[[:space:]]+initname.*"
    line=$(perf probe -L getname_flags 2>&1 | grep -E "$result_initname_re" | sed -r "s/$result_initname_re/\1/")
    ...
    if [ -z "$line" ] ; then
            echo "Could not find probeable line"
            return 2
    fi

Because stderr from perf probe -L is filtered through grep, any actual
debuginfo error message is discarded and add_probe_vfs_getname() prints
"Could not find probeable line" whenever line is empty.

However, line is also empty on current kernels with full debuginfo and
sources available because commit 9fa3ec84587c ("allow incomplete imports of
filenames") moved initname(result) into do_getname(), leaving getname_flags()
in fs/namei.c as a wrapper:

    struct filename *
    getname_flags(const char __user *filename, int flags)
    {
            return do_getname(filename, flags, false);
    }

It is also empty when compiler optimizations omit probeable line numbers in
getname_flags() (which commit 92b664dcefab handled), or when vmlinux DWARF
debuginfo is installed without kernel source files on disk.

When tools/perf/tests/shell/base_probe/test_adding_kernel.sh calls
skip_if_no_debuginfo():

    skip_if_no_debuginfo
    if [ $? -eq 2 ]; then
            NO_DEBUGINFO=1
    fi

wouldn't this change cause NO_DEBUGINFO=1 to be set unconditionally on
current kernels regardless of whether DWARF debuginfo is installed, skipping
the DWARF testcases in test_adding_kernel.sh that do not depend on
getname_flags()?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261105071711.31086-1-namhyung@kernel.org?part=1

  reply	other threads:[~2026-11-05  7:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  7:17 [PATCH] perf test: Fix perf probe testsuite Namhyung Kim
2026-11-05  7:37 ` sashiko-bot [this message]
2026-11-05 15:08 ` James Clark
2026-11-05 15:56   ` James Clark
2026-11-06  2:59     ` Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-198684@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox