Tests: Introduce gen-ust-events-constructor test application
[lttng-tools.git] / tests / utils / testapp / gen-ust-events-constructor / 02-define-tp.cpp
CommitLineData
a4cc1b1f
MD
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
9static void fct_constructor2(void);
10static void fct_destructor2(void);
11
12void test_constructor2_same_unit_before(void) __attribute__((constructor));
13void test_constructor2_same_unit_before(void)
14{
15 fct_constructor2();
16}
17
18void test_destructor2_same_unit_before(void) __attribute__((destructor));
19void test_destructor2_same_unit_before(void)
20{
21 fct_destructor2();
22}
23
24Obj g_obj_same_unit_before_define("global - same unit before define");
25
26#define TRACEPOINT_DEFINE
27#include "tp.h"
28
29Obj g_obj_same_unit_after_define("global - same unit after define");
30
31static void fct_constructor2(void)
32{
33 tracepoint(tp, constructor_c_same_unit_before_define);
34}
35
36static void fct_destructor2(void)
37{
38 tracepoint(tp, destructor_c_same_unit_before_define);
39}
40
41void test_constructor2_same_unit_after(void) __attribute__((constructor));
42void test_constructor2_same_unit_after(void)
43{
44 tracepoint(tp, constructor_c_same_unit_after_define);
45}
46
47void test_destructor2_same_unit_after(void) __attribute__((destructor));
48void test_destructor2_same_unit_after(void)
49{
50 tracepoint(tp, destructor_c_same_unit_after_define);
51}
This page took 0.025601 seconds and 4 git commands to generate.