[PATCH] perf test probe_vfs_getname: Also look for the probe line in do_getname()

From: Ian Rogers

Date: Mon Sep 28 2026 - 14:07:27 EST


Since commit 9fa3ec84587c ("allow incomplete imports of filenames"), in
v7.0, getname_flags() only calls do_getname(). None of the lines the
vfs_getname tests search for are in getname_flags() any more, so the
tests always skip. Fall back to the initname() call in do_getname().

Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
Tested on a v7.1.6 kernel with its debuginfo and fs/namei.c, which
perf probe -L needs. The three vfs_getname tests now pass instead of
skipping.

tools/perf/tests/shell/lib/probe_vfs_getname.sh | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/perf/tests/shell/lib/probe_vfs_getname.sh b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
index 88cd0e26d5f6..a4230a83bcae 100644
--- a/tools/perf/tests/shell/lib/probe_vfs_getname.sh
+++ b/tools/perf/tests/shell/lib/probe_vfs_getname.sh
@@ -13,6 +13,7 @@ cleanup_probe_vfs_getname() {
add_probe_vfs_getname() {
add_probe_verbose=$1
if [ $had_vfs_getname -eq 1 ] ; then
+ local func=getname_flags
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/")

@@ -28,13 +29,20 @@ add_probe_vfs_getname() {
line=$(perf probe -L getname_flags 2>&1 | grep -E "$result_aname_re" | sed -r "s/$result_aname_re/\1/")
fi

+ # Since v7.0 getname_flags() is a wrapper around do_getname().
+ if [ -z "$line" ] ; then
+ func=do_getname
+ line=$(perf probe -L $func 2>&1 | grep -E "$result_initname_re" |
+ sed -r "s/$result_initname_re/\1/")
+ fi
+
if [ -z "$line" ] ; then
echo "Could not find probeable line"
return 2
fi

- perf probe -q "vfs_getname=getname_flags:${line} pathname=result->name:string" || \
- perf probe $add_probe_verbose "vfs_getname=getname_flags:${line} pathname=filename:ustring" || return 1
+ perf probe -q "vfs_getname=${func}:${line} pathname=result->name:string" || \
+ perf probe $add_probe_verbose "vfs_getname=${func}:${line} pathname=filename:ustring" || return 1
fi
}

--
2.56.0.rc1.315.gc6ed9934b7-goog