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

global foo, bar
global i

probe begin
{
	print("starting up\n")
	i = 0
}

probe timer.jiffies(100)
{
	printf("ping %d\n", i)
	foo <<< ((100 * i) + 50)
	bar <<< (50 * i * i)
	if (i++ > 15)
		exit()
}

probe end
{
	print("shutting down\n")
	printf("count %d, avg %d\n", @count(foo), @avg(foo))
	print(@hist_log(foo))
	print(@hist_linear(bar, 1000, 10000, 1000))
	println(@hist_log(foo))
	println(@hist_linear(bar, 1000, 10000, 1000))
	print(sprint(@hist_log(foo)))
	print(sprint(@hist_linear(bar, 1000, 10000, 1000)))
	print(sprintln(@hist_log(foo)))
	print(sprintln(@hist_linear(bar, 1000, 10000, 1000)))
}