linux/linux-5.4.31/tools/testing/selftests/ftrace/test.d/kprobe/profile.tc

16 lines
527 B
Bash

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Kprobe dynamic event - adding and removing
[ -f kprobe_events ] || exit_unsupported # this is configurable
! grep -q 'myevent' kprobe_profile
echo p:myevent _do_fork > kprobe_events
grep -q 'myevent[[:space:]]*0[[:space:]]*0$' kprobe_profile
echo 1 > events/kprobes/myevent/enable
( echo "forked" )
grep -q 'myevent[[:space:]]*[[:digit:]]*[[:space:]]*0$' kprobe_profile
echo 0 > events/kprobes/myevent/enable
echo > kprobe_events
! grep -q 'myevent' kprobe_profile