* [PATCH v5 2/2] selftests/ftrace: Add new test case which checks non unique symbol
[not found] <20231018144030.86885-1-flaniel@linux.microsoft.com>
@ 2023-10-18 14:40 ` Francis Laniel
2023-10-18 16:55 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Francis Laniel @ 2023-10-18 14:40 UTC (permalink / raw)
To: linux-trace-kernel
Cc: Masami Hiramatsu, stable, Francis Laniel, Steven Rostedt,
Shuah Khan, linux-kernel, linux-kselftest
If name_show() is non unique, this test will try to install a kprobe on this
function which should fail returning EADDRNOTAVAIL.
On kernel where name_show() is not unique, this test is skipped.
Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
---
.../ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc
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
new file mode 100644
index 000000000000..bc9514428dba
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc
@@ -0,0 +1,13 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+# description: Test failure of registering kprobe on non unique symbol
+# requires: kprobe_events
+
+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
+ exit_unsupported
+fi
+
+! echo "p:test_non_unique ${SYMBOL}" > kprobe_events
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v5 2/2] selftests/ftrace: Add new test case which checks non unique symbol
2023-10-18 14:40 ` [PATCH v5 2/2] selftests/ftrace: Add new test case which checks non unique symbol Francis Laniel
@ 2023-10-18 16:55 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2023-10-18 16:55 UTC (permalink / raw)
To: Francis Laniel
Cc: linux-trace-kernel, Masami Hiramatsu, stable, Steven Rostedt,
Shuah Khan, linux-kernel, linux-kselftest
On Wed, Oct 18, 2023 at 05:40:30PM +0300, Francis Laniel wrote:
> If name_show() is non unique, this test will try to install a kprobe on this
> function which should fail returning EADDRNOTAVAIL.
> On kernel where name_show() is not unique, this test is skipped.
>
> Signed-off-by: Francis Laniel <flaniel@linux.microsoft.com>
> ---
> .../ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
> create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc
<formletter>
This is not the correct way to submit patches for inclusion in the
stable kernel tree. Please read:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.
</formletter>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-18 16:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20231018144030.86885-1-flaniel@linux.microsoft.com>
2023-10-18 14:40 ` [PATCH v5 2/2] selftests/ftrace: Add new test case which checks non unique symbol Francis Laniel
2023-10-18 16:55 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox