6 __attribute__ ((visibility ("protected"))) extern struct marker __start___markers
[];
7 __attribute__ ((visibility ("protected"))) extern struct marker __stop___markers
[];
10 * __mark_empty_function - Empty probe callback
11 * @probe_private: probe private data
12 * @call_private: call site private data
14 * @...: variable argument list
16 * Empty callback provided as a probe to the markers. By providing this to a
17 * disabled marker, we make sure the execution flow is always valid even
18 * though the function pointer change and the marker enabling are two distinct
19 * operations that modifies the execution flow of preemptible code.
21 __attribute__ ((visibility ("protected")))
22 void __mark_empty_function(void *probe_private
, void *call_private
,
23 const char *fmt
, va_list *args
)
28 * marker_probe_cb Callback that prepares the variable argument list for probes.
29 * @mdata: pointer of type struct marker
30 * @call_private: caller site private data
32 * @...: Variable argument list.
35 __attribute__ ((visibility ("protected")))
36 void marker_probe_cb(const struct marker
*mdata
, void *call_private
,
39 static unsigned int count
= 0;
41 printf("Test probe function %u\n", count
++);
44 //FIXME : imv_read won't work with optimized immediate values.
45 //will need to issue one sys_marker call for each immediate value.
46 __attribute__ ((visibility ("protected")))
49 printf("addr : %p\n", __builtin_return_address(0));
52 __attribute__((constructor
, visibility ("protected"))) void marker_init(void)
57 printf("Marker section : from %p to %p (init)\n",
58 __start___markers
, __stop___markers
);
60 for (iter
= __start___markers
; iter
< __stop___markers
; iter
++) {
61 printf("Marker : %s\n", iter
->name
);
62 ret
= sys_marker(iter
->name
, iter
->format
,
63 &imv_read(iter
->state
), 1);
65 perror("Error connecting markers");
69 static __attribute__((destructor
, visibility ("protected"))) void marker_fini(void)
74 printf("Marker section : from %p to %p (fini)\n",
75 __start___markers
, __stop___markers
);
76 for (iter
= __start___markers
; iter
< __stop___markers
; iter
++) {
77 printf("Marker : %s\n", iter
->name
);
78 ret
= sys_marker(iter
->name
, iter
->format
,
79 &imv_read(iter
->state
), 0);
81 perror("Error disconnecting markers");
This page took 0.036783 seconds and 5 git commands to generate.