License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-block.git] / tools / testing / selftests / ftrace / test.d / kprobe / multiple_kprobes.tc
CommitLineData
bdd7e3d6 1#!/bin/sh
b2441318 2# SPDX-License-Identifier: GPL-2.0
bdd7e3d6
MH
3# description: Register/unregister many kprobe events
4
84c06566
TM
5[ -f kprobe_events ] || exit_unsupported # this is configurable
6
bdd7e3d6 7# ftrace fentry skip size depends on the machine architecture.
f7181e5a 8# Currently HAVE_KPROBES_ON_FTRACE defined on x86 and powerpc64le
bdd7e3d6
MH
9case `uname -m` in
10 x86_64|i[3456]86) OFFS=5;;
f7181e5a 11 ppc64le) OFFS=8;;
bdd7e3d6
MH
12 *) OFFS=0;;
13esac
14
15echo "Setup up to 256 kprobes"
16grep t /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \
17head -n 256 | while read i; do echo p ${i}+${OFFS} ; done > kprobe_events ||:
18
19echo 1 > events/kprobes/enable
20echo 0 > events/kprobes/enable
21echo > kprobe_events
22echo "Waiting for unoptimizing & freeing"
23sleep 5
24echo "Done"