Commit | Line | Data |
---|---|---|
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 | #include "tp-a.h" | |
ab4919b5 | 9 | #include "tp-a_c.h" |
ed1b6b66 | 10 | #include "tp-so_c.h" |
a4cc1b1f MD |
11 | #include "tp-so.h" |
12 | #include "tp.h" | |
13 | ||
14 | /* Use tracepoints defined and provided by shared libraries. */ | |
15 | void test_constructor_so(void) __attribute__((constructor)); | |
16 | void test_constructor_so(void) | |
17 | { | |
ed1b6b66 | 18 | tracepoint(tp_so_c, constructor_c_provider_shared_library); |
a4cc1b1f MD |
19 | } |
20 | ||
21 | void test_destructor_so(void) __attribute__((destructor)); | |
22 | void test_destructor_so(void) | |
23 | { | |
ed1b6b66 | 24 | tracepoint(tp_so_c, destructor_c_provider_shared_library); |
a4cc1b1f MD |
25 | } |
26 | ||
27 | Objso g_objso_shared_library("global - shared library define and provider"); | |
28 | ||
29 | /* Use tracepoints defined and provided by static archive. */ | |
30 | void test_constructor_a(void) __attribute__((constructor)); | |
31 | void test_constructor_a(void) | |
32 | { | |
ab4919b5 | 33 | tracepoint(tp_a_c, constructor_c_provider_static_archive); |
a4cc1b1f MD |
34 | } |
35 | ||
36 | void test_destructor_a(void) __attribute__((destructor)); | |
37 | void test_destructor_a(void) | |
38 | { | |
ab4919b5 | 39 | tracepoint(tp_a_c, destructor_c_provider_static_archive); |
a4cc1b1f MD |
40 | } |
41 | ||
42 | Obja g_obja_static_archive("global - static archive define and provider"); | |
43 | ||
44 | int main(void) | |
45 | { | |
46 | Obj l_obj("main() local"); | |
47 | Objso l_objso("main() local - shared library define and provider"); | |
48 | Obja l_obja("main() local - static archive define and provider"); | |
49 | ||
50 | tracepoint(tp, main); | |
51 | return 0; | |
52 | } |