2 # SPDX-License-Identifier: GPL-2.0
3 # description: Kretprobe dynamic event with maxactive
5 [ -f kprobe_events
] || exit_unsupported
# this is configurable
6 grep -q 'r\[maxactive\]' README || exit_unsupported
# this is older version
10 # Test if we successfully reject unknown messages
11 if echo 'a:myprobeaccept inet_csk_accept' > kprobe_events
; then false
; else true
; fi
13 # Test if we successfully reject too big maxactive
14 if echo 'r1000000:myprobeaccept inet_csk_accept' > kprobe_events
; then false
; else true
; fi
16 # Test if we successfully reject unparsable numbers for maxactive
17 if echo 'r10fuzz:myprobeaccept inet_csk_accept' > kprobe_events
; then false
; else true
; fi
19 # Test for kretprobe with event name without maxactive
20 echo 'r:myprobeaccept inet_csk_accept' > kprobe_events
21 grep myprobeaccept kprobe_events
22 test -d events
/kprobes
/myprobeaccept
23 echo '-:myprobeaccept' >> kprobe_events
25 # Test for kretprobe with event name with a small maxactive
26 echo 'r10:myprobeaccept inet_csk_accept' > kprobe_events
27 grep myprobeaccept kprobe_events
28 test -d events
/kprobes
/myprobeaccept
29 echo '-:myprobeaccept' >> kprobe_events
31 # Test for kretprobe without event name without maxactive
32 echo 'r inet_csk_accept' > kprobe_events
33 grep inet_csk_accept kprobe_events
36 # Test for kretprobe without event name with a small maxactive
37 echo 'r10 inet_csk_accept' > kprobe_events
38 grep inet_csk_accept kprobe_events