99c5a086 |
1 | |
2 | #include "marker.h" |
52204d63 |
3 | #include <stdio.h> |
4 | |
5 | extern struct marker __start___markers[]; |
6 | extern struct marker __stop___markers[]; |
99c5a086 |
7 | |
8 | /** |
9 | * __mark_empty_function - Empty probe callback |
10 | * @probe_private: probe private data |
11 | * @call_private: call site private data |
12 | * @fmt: format string |
13 | * @...: variable argument list |
14 | * |
15 | * Empty callback provided as a probe to the markers. By providing this to a |
16 | * disabled marker, we make sure the execution flow is always valid even |
17 | * though the function pointer change and the marker enabling are two distinct |
18 | * operations that modifies the execution flow of preemptible code. |
19 | */ |
20 | void __mark_empty_function(void *probe_private, void *call_private, |
21 | const char *fmt, va_list *args) |
22 | { |
23 | } |
24 | |
25 | /* |
26 | * marker_probe_cb Callback that prepares the variable argument list for probes. |
27 | * @mdata: pointer of type struct marker |
28 | * @call_private: caller site private data |
29 | * @fmt: format string |
30 | * @...: Variable argument list. |
31 | * |
32 | */ |
33 | void marker_probe_cb(const struct marker *mdata, void *call_private, |
34 | const char *fmt, ...) |
35 | { |
36 | |
37 | |
38 | } |
52204d63 |
39 | |
40 | __attribute__((constructor)) void marker_init(void) |
41 | { |
42 | struct marker *iter; |
43 | |
44 | printf("Marker section : from %p to %p\n", |
45 | __start___markers, __stop___markers); |
46 | for (iter = __start___markers; iter < __stop___markers; iter++) { |
47 | printf("Marker : %s\n", iter->name); |
48 | } |
49 | } |