6 __attribute__ ((visibility ("protected")))
7 extern struct marker __start___markers
[];
9 __attribute__ ((visibility ("protected")))
10 extern struct marker __stop___markers
[];
13 * __mark_empty_function - Empty probe callback
14 * @probe_private: probe private data
15 * @call_private: call site private data
17 * @...: variable argument list
19 * Empty callback provided as a probe to the markers. By providing this to a
20 * disabled marker, we make sure the execution flow is always valid even
21 * though the function pointer change and the marker enabling are two distinct
22 * operations that modifies the execution flow of preemptible code.
24 __attribute__ ((visibility ("protected")))
25 void __mark_empty_function(void *probe_private
, void *call_private
,
26 const char *fmt
, va_list *args
)
31 * marker_probe_cb Callback that prepares the variable argument list for probes.
32 * @mdata: pointer of type struct marker
33 * @call_private: caller site private data
35 * @...: Variable argument list.
38 __attribute__ ((visibility ("protected")))
39 void marker_probe_cb(const struct marker
*mdata
, void *call_private
,
46 vsnprintf(buf
, PAGE_SIZE
-1, fmt
, ap
);
51 //FIXME : imv_read won't work with optimized immediate values.
52 //will need to issue one sys_marker call for each immediate value.
53 __attribute__ ((visibility ("protected")))
56 printf("addr : %p\n", __builtin_return_address(0));
59 __attribute__((constructor
, visibility ("protected")))
60 void marker_init(void)
65 printf("Marker section : from %p to %p (init)\n",
66 __start___markers
, __stop___markers
);
68 for (iter
= __start___markers
; iter
< __stop___markers
; iter
++) {
69 printf("Marker : %s\n", iter
->name
);
70 ret
= sys_marker(iter
->name
, iter
->format
,
71 &imv_read(iter
->state
), 1);
73 perror("Error connecting markers");
77 __attribute__((destructor
, visibility ("protected")))
78 void marker_fini(void)
83 printf("Marker section : from %p to %p (fini)\n",
84 __start___markers
, __stop___markers
);
85 for (iter
= __start___markers
; iter
< __stop___markers
; iter
++) {
86 printf("Marker : %s\n", iter
->name
);
87 ret
= sys_marker(iter
->name
, iter
->format
,
88 &imv_read(iter
->state
), 0);
90 perror("Error disconnecting markers");
This page took 0.032001 seconds and 4 git commands to generate.