Debian Codegraph @

testsuite/systemtap.exelib/pthreadprobes.stp

raw
1 global counters
2
3 probe pthread = process(@1) {}
4
5 @define mark(name) %(
6 probe init { counters[@name] = 0 }
7 probe pthread_mark = pthread.mark(@name)
8 %)
9
10 @mark("cond_broadcast") {}
11 @mark("cond_destroy") {}
12 @mark("cond_init") {}
13 @mark("cond_signal") {}
14 @mark("cond_timedwait") ? {}
15 @mark("cond_wait") {}
16 @mark("mutex_acquired") {}
17 @mark("mutex_destroy") {}
18 @mark("mutex_entry") {}
19 @mark("mutex_init") {}
20 @mark("mutex_release") {}
21 @mark("mutex_timedlock_acquired") {}
22 @mark("mutex_timedlock_entry") {}
23 @mark("pthread_create") {}
24 @mark("pthread_join") {}
25 @mark("pthread_join_ret") {}
26 @mark("pthread_start") {}
27 @mark("rdlock_entry") {}
28 @mark("rwlock_destroy") {}
29 @mark("wrlock_entry") {}
30
31 probe pthread_mark { ++counters[$$name]; }
32
33 probe end {
34 foreach (counter = [name] in counters)
35 printf("%s=%d\n", name, counter)
36 }
37