1 #!/bin/sh 2 # SPDX-License-Identifier: GPL-2.0 3 # description: Generic dynamic event - add/remove/test uprobe events 4 # requires: uprobe_events 5 6 echo 0 > events/enable 7 echo > dynamic_events 8 9 echo 'cat /proc/$$/maps' | /bin/sh | \ 10 grep "r-xp .*/bin/.*sh$" | \ 11 awk '{printf "p:myevent %s:0x%s\n", $6,$3 }' >> uprobe_events 12 13 grep -q myevent uprobe_events 14 test -d events/uprobes/myevent 15 16 echo 1 > events/uprobes/myevent/enable 17 echo 'ls' | /bin/sh > /dev/null 18 echo 0 > events/uprobes/myevent/enable 19 grep -q myevent trace 20 21 echo "-:myevent" >> uprobe_events 22 ! grep -q myevent uprobe_events 23 24 echo > uprobe_events 25 26 clear_trace
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.