summaryrefslogtreecommitdiffstats
path: root/testsuite/buildok/pmap_foreach.stp
blob: 8cc8decd0998833624baf52c165a16e84d2bd159 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! stap -p4

global foo


probe begin {
	for (i=0;i<10;i+=2) { 
		foo[1] <<< i	
		foo[2] <<< i*i
		foo[3] <<< i*i*i
	}
	foo[3] <<< 4*4*4
	exit()
}

probe end {
	for (i=1;i<4;i++)
		printf("count of foo[%d] = %d\n", i, @count(foo[i]))

	foreach (i in foo)
		printf("count of foo[%d] = %d\n", i, @count(foo[i]))
}