summaryrefslogtreecommitdiffstats
path: root/testsuite/buildok/context_test.stp
blob: d0b428906b05d0ab76db789a4c17047a3f06031f (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
#! stap -p4

function print_stuff () {
	print_regs()
	print_backtrace()
	bt = backtrace()
	print("the stack is " . bt)
	print("\n\n")
	print_stack(bt)
	print("\n\n")
	printf("execname is %s\n", execname())
	printf("pid is %d\n",pid())
	printf("tid is %d\n", tid())
	printf("pexecname is %s\n", pexecname())
	printf("ppid is %d\n", ppid())
	printf("uid is %d\n", uid())
	printf("euid is %d\n", euid())
	printf("gid is %d\n", gid())
	printf("egid is %d\n", egid())
	printf("pp is %s\n", pp())
	printf("sid is %d\n", sid())
}

probe kernel.function("uptime_read_proc") ? {
	print("NOW IN UPTIME\n")
	print_stuff ()
}

probe kernel.function("uptime_read_proc").return ? {
	print("DONE WITH UPTIME\n")
	print_stuff ()
	exit ()
}

probe begin {
	print ("BEGIN\n")
}

probe end {
	print ("END\n")
}