Skip to content

Commit a2f7990

Browse files
mhiramatshuahkh
authored andcommitted
selftests: tracing: Update fprobe selftest for ftrace based fprobe
Since the ftrace fprobe is both fgraph and ftrace based implemented, the selftest needs to be updated. This does not count the actual number of lines, but just check the differences. Link: https://lore.kernel.org/r/176295318112.431538.11780280333728368327.stgit@devnote2 Signed-off-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent a1ca238 commit a2f7990

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

tools/testing/selftests/ftrace/test.d/dynevent/add_remove_fprobe.tc

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,21 @@ test -d events/fprobes/myevent1
2828
test -d events/fprobes/myevent2
2929

3030
echo 1 > events/fprobes/myevent1/enable
31-
# Make sure the event is attached and is the only one
31+
# Make sure the event is attached.
3232
grep -q $PLACE enabled_functions
3333
cnt=`cat enabled_functions | wc -l`
34-
if [ $cnt -ne $((ocnt + 1)) ]; then
34+
if [ $cnt -eq $ocnt ]; then
3535
exit_fail
3636
fi
3737

3838
echo 1 > events/fprobes/myevent2/enable
39-
# It should till be the only attached function
40-
cnt=`cat enabled_functions | wc -l`
41-
if [ $cnt -ne $((ocnt + 1)) ]; then
42-
exit_fail
43-
fi
39+
cnt2=`cat enabled_functions | wc -l`
4440

4541
echo 1 > events/fprobes/myevent3/enable
4642
# If the function is different, the attached function should be increased
4743
grep -q $PLACE2 enabled_functions
4844
cnt=`cat enabled_functions | wc -l`
49-
if [ $cnt -ne $((ocnt + 2)) ]; then
45+
if [ $cnt -eq $cnt2 ]; then
5046
exit_fail
5147
fi
5248

@@ -56,12 +52,6 @@ echo "-:myevent2" >> dynamic_events
5652
grep -q myevent1 dynamic_events
5753
! grep -q myevent2 dynamic_events
5854

59-
# should still have 2 left
60-
cnt=`cat enabled_functions | wc -l`
61-
if [ $cnt -ne $((ocnt + 2)) ]; then
62-
exit_fail
63-
fi
64-
6555
echo 0 > events/fprobes/enable
6656
echo > dynamic_events
6757

0 commit comments

Comments
 (0)