Skip to contentSkip to conversation

selftests/ftrace: avoid failure when trying to probe a notrace function

PATCH In review Thadeu Lima de Souza Cascardo 2 participants 3 messages Jul 8, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/ftrace: avoid failure when trying to probe a notrace function

Check that the function is on available_filter_functions. If it's not, mark the test as unresolved, instead of failing it.

---
 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc +1 -0
index 3fb70e01b1fe..e4dff034da12 100644
@@ -26,6 +26,7 @@ test -d events/kprobes2/event2 || exit_failure
 
 FUNC=`grep -m 10 " [tT] .*\.isra\..*$" /proc/kallsyms | tail -n 1 | cut -f 3 -d " "`
 [ "x" != "x$FUNC" ] || exit_unresolved
+grep -n "$FUNC" available_filter_functions || exit_unresolved
 echo "p $FUNC" > kprobe_events
 EVENT=`grep $FUNC kprobe_events | cut -f 1 -d " " | cut -f 2 -d:`
 [ "x" != "x$EVENT" ] || exit_failure
Signature · 1 line
2.20.1
maintainer
#1 lore raw
Quoted 3 lines · On Mon, 8 Jul 2019 15:19:33 -0300 Thadeu Lima de Souza Cascardo…

Check that the function is on available_filter_functions. If it's not, mark the test as unresolved, instead of failing it.

Actually, I sent this out a while ago:

http://lkml.kernel.org/r/[email protected]

Does that fix it for you?

-- Steve

Quoted 17 lines
---
 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc +1 -0
index 3fb70e01b1fe..e4dff034da12 100644
@@ -26,6 +26,7 @@ test -d events/kprobes2/event2 || exit_failure
 
 FUNC=`grep -m 10 " [tT] .*\.isra\..*$" /proc/kallsyms | tail -n 1 | cut -f 3 -d " "`
 [ "x" != "x$FUNC" ] || exit_unresolved
+grep -n "$FUNC" available_filter_functions || exit_unresolved
 echo "p $FUNC" > kprobe_events
 EVENT=`grep $FUNC kprobe_events | cut -f 1 -d " " | cut -f 2 -d:`
 [ "x" != "x$EVENT" ] || exit_failure
#2 lore raw
Quoted 7 lines · Steven Rostedt
Quoted 3 lines · On Mon, 8 Jul 2019 15:19:33 -0300 Thadeu Lima de Souza Cascardo…

Check that the function is on available_filter_functions. If it's not, mark the test as unresolved, instead of failing it.

Quoted 7 lines

Actually, I sent this out a while ago:

http://lkml.kernel.org/r/[email protected]

Does that fix it for you?

-- Steve

Yes, that fix it for me, let me reply to the original message.

Thanks!
Cascardo.

Quoted 20 lines
Quoted 19 lines
---
 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_eventname.tc +1 -0
index 3fb70e01b1fe..e4dff034da12 100644
@@ -26,6 +26,7 @@ test -d events/kprobes2/event2 || exit_failure
 
 FUNC=`grep -m 10 " [tT] .*\.isra\..*$" /proc/kallsyms | tail -n 1 | cut -f 3 -d " "`
 [ "x" != "x$FUNC" ] || exit_unresolved
+grep -n "$FUNC" available_filter_functions || exit_unresolved
 echo "p $FUNC" > kprobe_events
 EVENT=`grep $FUNC kprobe_events | cut -f 1 -d " " | cut -f 2 -d:`
 [ "x" != "x$EVENT" ] || exit_failure