Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cris-mirror.git] / tools / testing / selftests / ftrace / test.d / kprobe / kretprobe_maxactive.tc
blob7c0290684c4387f8d35daf56c8a62c41d51449ca
1 #!/bin/sh
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
8 echo > kprobe_events
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
34 echo > 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
39 echo > kprobe_events
41 clear_trace