fix: relayd: unaligned access in trace_chunk_registry_ht_key_hash
[lttng-tools.git] / tests / utils / testapp / gen-ust-events-constructor / 02-define-tp.cpp
1 /*
2 * Copyright (C) 2023 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7 #include "obj.h"
8
9 static void fct_constructor2(void);
10 static void fct_destructor2(void);
11
12 void test_constructor2_same_unit_before(void) __attribute__((constructor));
13 void test_constructor2_same_unit_before(void)
14 {
15 fct_constructor2();
16 }
17
18 void test_destructor2_same_unit_before(void) __attribute__((destructor));
19 void test_destructor2_same_unit_before(void)
20 {
21 fct_destructor2();
22 }
23
24 Obj g_obj_same_unit_before_define("global - same unit before define");
25
26 #define TRACEPOINT_DEFINE
27 #include "tp.h"
28
29 Obj g_obj_same_unit_after_define("global - same unit after define");
30
31 static void fct_constructor2(void)
32 {
33 tracepoint(tp, constructor_c_same_unit_before_define);
34 }
35
36 static void fct_destructor2(void)
37 {
38 tracepoint(tp, destructor_c_same_unit_before_define);
39 }
40
41 void test_constructor2_same_unit_after(void) __attribute__((constructor));
42 void test_constructor2_same_unit_after(void)
43 {
44 tracepoint(tp, constructor_c_same_unit_after_define);
45 }
46
47 void test_destructor2_same_unit_after(void) __attribute__((destructor));
48 void test_destructor2_same_unit_after(void)
49 {
50 tracepoint(tp, destructor_c_same_unit_after_define);
51 }
This page took 0.029157 seconds and 4 git commands to generate.