[PATCH 1/2] ftrace/selftests: Fix regex pattern to match vmlinux symbol names only
From: Alexander Gordeev
Date: Tue Aug 25 2026 - 12:59:00 EST
Commit 1870ddcd94b0 ("bpf: Prefer vmlinux symbols over module symbols
for unqualified kprobes") changed unqualified kprobe lookup to prefer
a unique vmlinux symbol even when modules export symbols with the same
name.
Reflect this change in the test and anchor the grep pattern at the end
of the line so it only counts vmlinux symbols and skips module ones.
Suggested-by: Sven Schnelle <svens@xxxxxxxxxxxxx>
Signed-off-by: Alexander Gordeev <agordeev@xxxxxxxxxxxxx>
---
.../selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc
index bc9514428dba..07b1177c1634 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc
@@ -6,7 +6,7 @@
SYMBOL='name_show'
# We skip this test on kernel where SYMBOL is unique or does not exist.
-if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}" /proc/kallsyms)" -le '1' ]; then
+if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}$" /proc/kallsyms)" -le '1' ]; then
exit_unsupported
fi
--
2.53.0