Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/sdt.c

raw
1 #include "sys/sdt.h"
2
3 int my_global_var = 56;
4
5 static void call0(void)
6 {
7 STAP_PROBE(test, mark_z);
8 my_global_var++;
9 }
10
11 static void call1(int a)
12 {
13 STAP_PROBE1(test, mark_a, a);
14 }
15
16 static void call2(int a, int b)
17 {
18 STAP_PROBE2(test, mark_b, a, b);
19 }
20
21 static void call3(int a, int b, int c)
22 {
23 STAP_PROBE3(test, mark_c, a, b, c);
24 }
25
26 static void call4(int a, int b, int c, int d)
27 {
28 STAP_PROBE4(test, mark_d, a, b, c, d);
29 }
30
31 static void call5(int a, int b, int c, int d, int e)
32 {
33 STAP_PROBE5(test, mark_e, a, b, c, d, e);
34 }
35
36 static void call6(int a, int b, int c, int d, int e, int f)
37 {
38 STAP_PROBE6(test, mark_f, a, b, c, d, e, f);
39 }
40
41 static void call7(int a, int b, int c, int d, int e, int f, int g)
42 {
43 STAP_PROBE7(test, mark_g, a, b, c, d, e, f, g);
44 }
45
46 static void call8(int a, int b, int c, int d, int e, int f, int g, int h)
47 {
48 STAP_PROBE8(test, mark_h, a, b, c, d, e, f, g, h);
49 }
50
51 static void call9(int a, int b, int c, int d, int e, int f, int g, int h, int i)
52 {
53 STAP_PROBE9(test, mark_i, a, b, c, d, e, f, g, h, i);
54 }
55
56 static void call10(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j)
57 {
58 STAP_PROBE10(test, mark_j, a, b, c, d, e, f, g, h, i, j);
59 }
60
61 /* I CAN HAZ MOAR ARGS? */
62 #ifdef STAP_PROBE12
63 static void call11(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k)
64 {
65 STAP_PROBE11(test, mark_k, a, b, c, d, e, f, g, h, i, j, k);
66 }
67
68 static void call12(int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l)
69 {
70 STAP_PROBE12(test, mark_l, a, b, c, d, e, f, g, h, i, j, k, l);
71 }
72 #endif
73
74 int
75 main (int argc, char **argv)
76 {
77 int a, b, c, d, e, f, g, h, i, j, k, l;
78 a = 1; b = 2; c = 3; d = 4; e = 5; f = 6; g = 7; h = 8; i = 9; j = 10; k = 11; l = 12;
79 call0();
80 call1(a);
81 call2(a, b);
82 call3(a, b, c);
83 call4(a, b, c, d);
84 call5(a, b, c, d, e);
85 call6(a, b, c, d, e, f);
86 call7(a, b, c, d, e, f, g);
87 call8(a, b, c, d, e, f, g, h);
88 call9(a, b, c, d, e, f, g, h, i);
89 call10(a, b, c, d, e, f, g, h, i, j);
90 #ifdef STAP_PROBE12
91 call11(a, b, c, d, e, f, g, h, i, j, k);
92 call12(a, b, c, d, e, f, g, h, i, j, k, l);
93 #else
94 (void)(k + l);
95 #endif
96 (void) argv;
97 (void) argc;
98 return 0;
99 }