Skip to contentSkip to conversation

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

PATCH Applied Ian Rogers 3 participants 3 messages Sep 28 perf events

lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 perf test probe_vfs_getname: Also look for the probe line in do_getname()

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

---
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(-)
tools/perf/tests/shell/lib/probe_vfs_getname.sh +10 -2
index 88cd0e26d5f6..a4230a83bcae 100644
@@ -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
 }
 
Signature · 1 line
2.56.0.rc1.315.gc6ed9934b7-goog
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 7 lines

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

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer Applied
#2 lore raw
In reply to Ian Rogers
Quoted 4 lines · Ian Rogers

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().

Thanks, applied to perf-tools-next, for v7.4.

- Arnaldo