Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/array_size.stp

raw
1 /*
2 * array_size.stp
3 *
4 * Check that specifying an array size gives more room than MAXMAPENTRIES
5 *
6 * Call with MAXMAPENTRIES << 100
7 */
8
9 probe begin { println("systemtap starting probe") }
10 probe end { println("systemtap ending probe") }
11
12 global a[100]
13
14 probe begin {
15 for (i=42; i<142; ++i)
16 a[i] = i*i
17 }
18
19 probe end(1) {
20 for (i=42; i<142; ++i) {
21 if (a[i] == i*i)
22 ++ok
23 else
24 ++bad
25 }
26 if (ok == 100 && bad == 0)
27 println("systemtap test success")
28 else
29 printf("systemtap test failure - ok:%d, bad:%d\n", ok, bad)
30 }