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

global foo
global i

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

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

probe end
{
	print("shutting down\n")
	printf("count %d, avg %d\n", @count(foo), @avg(foo))
	for (i = 0; i < 7; ++i)
	{	
		printf("bucket %d: %d\n", i, @hist_log(foo)[i])
	}
}