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