Debian Codegraph @

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

raw
1 #! stap
2
3 # test that polling loops do not exit when conflicts happen
4 # see PR 1379
5
6 global called, num_polls
7
8 probe kernel.function( "vfs_*" ).call {
9 called[execname(),probefunc()]++
10 }
11
12 probe timer.ms(100)
13 {
14 print("\n\n")
15 num_to_do = 10
16 foreach ([n,f] in called-) {
17 printf("%s called %s\t%d times\n", n, f, called[n,f])
18 num_to_do--
19 if (num_to_do <= 0)
20 break
21 }
22 delete called
23 num_polls++
24 if (num_polls > 30)
25 exit()
26 }
27
28 probe end {
29 if (num_polls <= 30)
30 print ("FAIL\n")
31 else
32 print ("SUCCESS\n")
33 }