| .. | .. |
|---|
| 1 | 1 | #!/bin/sh |
|---|
| 2 | 2 | # SPDX-License-Identifier: GPL-2.0 |
|---|
| 3 | 3 | # description: Kprobe dynamic event with arguments |
|---|
| 4 | +# requires: kprobe_events |
|---|
| 4 | 5 | |
|---|
| 5 | | -[ -f kprobe_events ] || exit_unsupported # this is configurable |
|---|
| 6 | | - |
|---|
| 7 | | -echo 0 > events/enable |
|---|
| 8 | | -echo > kprobe_events |
|---|
| 9 | | -echo 'p:testprobe _do_fork $stack $stack0 +0($stack)' > kprobe_events |
|---|
| 10 | | -grep testprobe kprobe_events |
|---|
| 6 | +echo "p:testprobe $FUNCTION_FORK \$stack \$stack0 +0(\$stack)" > kprobe_events |
|---|
| 7 | +grep testprobe kprobe_events | grep -q 'arg1=\$stack arg2=\$stack0 arg3=+0(\$stack)' |
|---|
| 11 | 8 | test -d events/kprobes/testprobe |
|---|
| 9 | + |
|---|
| 12 | 10 | echo 1 > events/kprobes/testprobe/enable |
|---|
| 13 | 11 | ( echo "forked") |
|---|
| 12 | +grep testprobe trace | grep "$FUNCTION_FORK" | \ |
|---|
| 13 | + grep -q 'arg1=0x[[:xdigit:]]* arg2=0x[[:xdigit:]]* arg3=0x[[:xdigit:]]*$' |
|---|
| 14 | + |
|---|
| 14 | 15 | echo 0 > events/kprobes/testprobe/enable |
|---|
| 15 | 16 | echo "-:testprobe" >> kprobe_events |
|---|
| 16 | 17 | clear_trace |
|---|