summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/onoffprobe.stp
blob: 11968540853fc1b17e583c3f0ff947c8aa7eb7cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
global switch=0

#begin probe
probe begin if (switch==0) {
	log("begin probed\n");
}

#dwarf probe (return)
probe kernel.function("sys_write").return if (switch == 1) {
	log("function return probed\n")
	switch = 0
}

#dwarf probe (entry)
probe kernel.function("sys_write") if (switch == 2) {
	log("function entry probed\n")
	switch = 0
}

#timer probe
probe timer.s(1) if (switch == 3) {
	log("timer probed\n")
	switch = 0
}

#profile probe
probe timer.profile if (switch == 4) {
	log("profile probed\n")
	switch = 0
}

probe procfs("switch").write {
	switch = strtol($value, 10)
}