summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/onoffprobe.stp
blob: f716903936a75bc7979a4fe096d959719e7682ff (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
36
37
38
39
40
41
42
43
44
45
46
global switch=-1

#begin probe
probe begin if (switch==-1) {
	log("begin1 probed");
}

probe begin if (switch==0) {
	log("begin2 probed");
}

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

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

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

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

# aliasess
probe alias.one.a  = timer.s(2) if (switch == 5) { print("alias.one.a and") }
probe alias.one.b  = timer.s(3) if (switch == 6) { print("alias.one.b and") }
probe alias.one = alias.one.* if (switch >= 5 && switch < 7) { print(" alias.one and") }
probe alias.two = timer.s(4) if (switch == 7) { print("alias.two and") }
probe alias.* if (switch) { log(" alias.* probed") }

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