2 # SPDX-License-Identifier: GPL-2.0
3 # description: Register/unregister many kprobe events
5 [ -f kprobe_events
] || exit_unsupported
# this is configurable
7 # ftrace fentry skip size depends on the machine architecture.
8 # Currently HAVE_KPROBES_ON_FTRACE defined on x86 and powerpc64le
10 x86_64|i
[3456]86) OFFS
=5;;
16 echo "Setup up kprobes on first available 256 text symbols"
17 grep -i " t " /proc
/kallsyms | cut
-f3 -d" " |
grep -v .
*\\..
* | \
19 echo p
${i}+${OFFS} >> kprobe_events
&& N
=$
((N
+1)) ||
:
20 test $N -eq 256 && break
23 L
=`wc -l kprobe_events`
24 if [ $L -ne $N ]; then
25 echo "The number of kprobes events ($L) is not $N"
29 echo 1 > events
/kprobes
/enable
30 echo 0 > events
/kprobes
/enable
32 echo "Waiting for unoptimizing & freeing"