Debian Codegraph @

examples/barectf-tracepoint/barectf-tracepoint-qemu-arm-uart.h

raw
1 #ifndef _BARECTF_TRACEPOINT_QEMU_ARM_UART
2 #define _BARECTF_TRACEPOINT_QEMU_ARM_UART
3
4 /*
5 * The MIT License (MIT)
6 *
7 * Copyright (c) 2016 Philippe Proulx <[email protected]>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to deal
11 * in the Software without restriction, including without limitation the rights
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 * copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 * THE SOFTWARE.
26 */
27
28 #include <barectf-platform-qemu-arm-uart.h>
29
30 /*
31 * Include generated barectf header file: this contains the prefix and
32 * default stream name to be used by the tracepoint() macro.
33 */
34 #include "barectf.h"
35
36 /* define how the context is to be found by tracepoint() calls */
37 #define BARECTF_TRACEPOINT_CTX (global_barectf_ctx)
38
39 /* then include this: */
40 #include <barectf-tracepoint.h>
41
42 /* global barectf context (default stream) */
43 static struct barectf_default_ctx *global_barectf_ctx;
44
45 /* init function for this version */
46 static void init_tracing(void)
47 {
48 /* initialize platform */
49 barectf_platform_qemu_arm_uart_init();
50 global_barectf_ctx = barectf_platform_qemu_arm_uart_get_barectf_ctx();
51 }
52
53 /* finalization function for this version */
54 static void fini_tracing(void)
55 {
56 /* finalize platform */
57 barectf_platform_qemu_arm_uart_fini();
58 }
59
60 #endif /* _BARECTF_TRACEPOINT_QEMU_ARM_UART */