1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3# description: Generic dynamic event - add/remove tracepoint probe events
4# requires: dynamic_events "t[:[<group>/][<event>]] <tracepoint> [<args>]":README
5
6echo 0 > events/enable
7echo > dynamic_events
8
9TRACEPOINT1=kmem_cache_alloc
10TRACEPOINT2=kmem_cache_free
11
12echo "t:myevent1 $TRACEPOINT1" >> dynamic_events
13echo "t:myevent2 $TRACEPOINT2" >> dynamic_events
14
15grep -q myevent1 dynamic_events
16grep -q myevent2 dynamic_events
17test -d events/tracepoints/myevent1
18test -d events/tracepoints/myevent2
19
20echo "-:myevent2" >> dynamic_events
21
22grep -q myevent1 dynamic_events
23! grep -q myevent2 dynamic_events
24
25echo > dynamic_events
26
27clear_trace
28