* [PATCH 0/2] ftrace/selftests: Fix registering kprobe on non-unique symbol
@ 2026-08-25 16:58 Alexander Gordeev
2026-08-25 16:58 ` [PATCH 1/2] ftrace/selftests: Fix regex pattern to match vmlinux symbol names only Alexander Gordeev
2026-08-25 16:58 ` [PATCH 2/2] ftrace/selftests: Change non-unique test symbol to init_once Alexander Gordeev
0 siblings, 2 replies; 3+ messages in thread
From: Alexander Gordeev @ 2026-08-25 16:58 UTC (permalink / raw)
To: Steven Rostedt, Masami Hiramatsu, Shuah Khan
Cc: linux-kernel, linux-trace-kernel, linux-kselftest
Hi All!
Commit 1870ddcd94b0 ("bpf: Prefer vmlinux symbols over module symbols
for unqualified kprobes") broke registering kprobe on non-unique symbol
test - fix and improve it.
Thanks!
Alexander Gordeev (2):
ftrace/selftests: Fix regex pattern to match vmlinux symbol names only
ftrace/selftests: Change non-unique test symbol to init_once
.../selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] ftrace/selftests: Fix regex pattern to match vmlinux symbol names only
2026-08-25 16:58 [PATCH 0/2] ftrace/selftests: Fix registering kprobe on non-unique symbol Alexander Gordeev
@ 2026-08-25 16:58 ` Alexander Gordeev
2026-08-25 16:58 ` [PATCH 2/2] ftrace/selftests: Change non-unique test symbol to init_once Alexander Gordeev
1 sibling, 0 replies; 3+ messages in thread
From: Alexander Gordeev @ 2026-08-25 16:58 UTC (permalink / raw)
To: Steven Rostedt, Masami Hiramatsu, Shuah Khan
Cc: linux-kernel, linux-trace-kernel, linux-kselftest
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@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
---
.../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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] ftrace/selftests: Change non-unique test symbol to init_once
2026-08-25 16:58 [PATCH 0/2] ftrace/selftests: Fix registering kprobe on non-unique symbol Alexander Gordeev
2026-08-25 16:58 ` [PATCH 1/2] ftrace/selftests: Fix regex pattern to match vmlinux symbol names only Alexander Gordeev
@ 2026-08-25 16:58 ` Alexander Gordeev
1 sibling, 0 replies; 3+ messages in thread
From: Alexander Gordeev @ 2026-08-25 16:58 UTC (permalink / raw)
To: Steven Rostedt, Masami Hiramatsu, Shuah Khan
Cc: linux-kernel, linux-trace-kernel, linux-kselftest
The name_show symbol is not the best choise, because it often
appears only three times on s390 in kallsyms, with two of them
having module annotations [mdev] and [i2c_core].
Switch to init_once which has many more duplicate instances
all in vmlinux, making it a more reliable non-unique symbol
for testing kprobe registration failure.
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
---
.../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 07b1177c1634..03eb9e70b438 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
@@ -3,7 +3,7 @@
# description: Test failure of registering kprobe on non unique symbol
# requires: kprobe_events
-SYMBOL='name_show'
+SYMBOL='init_once'
# 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
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-25 16:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25 16:58 [PATCH 0/2] ftrace/selftests: Fix registering kprobe on non-unique symbol Alexander Gordeev
2026-08-25 16:58 ` [PATCH 1/2] ftrace/selftests: Fix regex pattern to match vmlinux symbol names only Alexander Gordeev
2026-08-25 16:58 ` [PATCH 2/2] ftrace/selftests: Change non-unique test symbol to init_once Alexander Gordeev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox