Commit | Line | Data |
---|---|---|
e5298fbc PP |
1 | #ifndef _BARECTF_TRACEPOINT_LINUX_FS |
2 | #define _BARECTF_TRACEPOINT_LINUX_FS | |
3 | ||
4 | #include <barectf-platform-linux-fs.h> | |
5 | ||
6 | /* | |
7 | * Include generated barectf header file: this contains the prefix and | |
8 | * default stream name to be used by the tracepoint() macro. | |
9 | */ | |
10 | #include "barectf.h" | |
11 | ||
12 | /* define how the context is to be found by tracepoint() calls */ | |
13 | #define BARECTF_TRACEPOINT_CTX (global_barectf_ctx) | |
14 | ||
15 | /* then include this: */ | |
16 | #include <barectf-tracepoint.h> | |
17 | ||
18 | /* global barectf context (default stream) */ | |
19 | static struct barectf_default_ctx *global_barectf_ctx; | |
20 | ||
21 | /* global barectf platform context */ | |
22 | static struct barectf_platform_linux_fs_ctx *global_barectf_platform_ctx; | |
23 | ||
24 | /* init function for this version */ | |
25 | static void init_tracing(void) | |
26 | { | |
27 | /* initialize platform */ | |
28 | global_barectf_platform_ctx = | |
d2a238e3 | 29 | barectf_platform_linux_fs_init(512, "ctf-linux-fs", 1, 2, 7); |
e5298fbc PP |
30 | |
31 | if (!global_barectf_platform_ctx) { | |
32 | fprintf(stderr, "Error: could not initialize platform\n"); | |
33 | exit(1); | |
34 | } | |
35 | ||
36 | global_barectf_ctx = barectf_platform_linux_fs_get_barectf_ctx( | |
37 | global_barectf_platform_ctx); | |
38 | } | |
39 | ||
40 | /* finalization function for this version */ | |
41 | static void fini_tracing(void) | |
42 | { | |
43 | /* finalize platform */ | |
44 | barectf_platform_linux_fs_fini(global_barectf_platform_ctx); | |
45 | } | |
46 | ||
47 | #endif /* _BARECTF_TRACEPOINT_LINUX_FS */ |