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