1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3# description: Kprobe event with comm arguments
4
5[ -f kprobe_events ] || exit_unsupported # this is configurable
6
7grep -A1 "fetcharg:" README | grep -q "\$comm" || exit_unsupported # this is too old
8
9echo 'p:testprobe _do_fork comm=$comm ' > kprobe_events
10grep testprobe kprobe_events | grep -q 'comm=$comm'
11test -d events/kprobes/testprobe
12
13echo 1 > events/kprobes/testprobe/enable
14( echo "forked")
15grep testprobe trace | grep -q 'comm=".*"'
16
17exit 0
18