1dbc3f042SMasami Hiramatsu#!/bin/sh 2dbc3f042SMasami Hiramatsu# SPDX-License-Identifier: GPL-2.0 3dbc3f042SMasami Hiramatsu# description: Generic dynamic event - add/remove kprobe events 41b8eec51SMasami Hiramatsu# requires: dynamic_events "place: [<module>:]<symbol>":README "place (kretprobe): [<module>:]<symbol>":README 5dbc3f042SMasami Hiramatsu 6dbc3f042SMasami Hiramatsuecho 0 > events/enable 7dbc3f042SMasami Hiramatsuecho > dynamic_events 8dbc3f042SMasami Hiramatsu 9dc6bf4daSSteven Rostedt (VMware)PLACE=$FUNCTION_FORK 10dbc3f042SMasami Hiramatsu 11dbc3f042SMasami Hiramatsuecho "p:myevent1 $PLACE" >> dynamic_events 12dbc3f042SMasami Hiramatsuecho "r:myevent2 $PLACE" >> dynamic_events 13dbc3f042SMasami Hiramatsu 14dbc3f042SMasami Hiramatsugrep -q myevent1 dynamic_events 15dbc3f042SMasami Hiramatsugrep -q myevent2 dynamic_events 16dbc3f042SMasami Hiramatsutest -d events/kprobes/myevent1 17dbc3f042SMasami Hiramatsutest -d events/kprobes/myevent2 18dbc3f042SMasami Hiramatsu 19dbc3f042SMasami Hiramatsuecho "-:myevent2" >> dynamic_events 20dbc3f042SMasami Hiramatsu 21dbc3f042SMasami Hiramatsugrep -q myevent1 dynamic_events 22dbc3f042SMasami Hiramatsu! grep -q myevent2 dynamic_events 23dbc3f042SMasami Hiramatsu 24dbc3f042SMasami Hiramatsuecho > dynamic_events 25dbc3f042SMasami Hiramatsu 26*5db19792SLinyu Yuanif grep -q "p\[:\[<group>/]\[<event>]]" README; then 27*5db19792SLinyu Yuan echo "p:mygroup/ $PLACE" >> dynamic_events 28*5db19792SLinyu Yuan test -d events/mygroup 29*5db19792SLinyu Yuan echo "-:mygroup/" >> dynamic_events 30*5db19792SLinyu Yuan ! test -d events/mygroup 31*5db19792SLinyu Yuanfi 32*5db19792SLinyu Yuan 33dbc3f042SMasami Hiramatsuclear_trace 34