Commit | Line | Data |
---|---|---|
df09bde5 MJ |
1 | /* |
2 | * SPDX-License-Identifier: LGPL-2.1-only | |
3 | * | |
4 | * Copyright (C) 2021 Michael Jeanson <mjeanson@efficios.com> | |
5 | */ | |
6 | ||
fca97dfd MJ |
7 | #include <lttng/ust-common.h> |
8 | ||
df09bde5 MJ |
9 | #include "common/logging.h" |
10 | #include "common/ust-fd.h" | |
fca97dfd MJ |
11 | #include "common/getenv.h" |
12 | ||
13 | #include "lib/lttng-ust-common/fd-tracker.h" | |
f41a6b5f | 14 | #include "lib/lttng-ust-common/clock.h" |
df09bde5 | 15 | |
fca97dfd MJ |
16 | /* |
17 | * The liblttng-ust-common constructor, initialize the internal shared state. | |
18 | * Libraries linking on liblttng-ust-common should also call this early in | |
19 | * their constructor since there is no reliable way to guarantee the execution | |
20 | * order of constructors across shared library. | |
21 | */ | |
22 | void lttng_ust_common_ctor(void) | |
df09bde5 | 23 | { |
df09bde5 | 24 | /* |
fca97dfd | 25 | * Initialize the shared state of the fd tracker. |
df09bde5 | 26 | */ |
fca97dfd | 27 | lttng_ust_fd_tracker_init(); |
f41a6b5f MJ |
28 | |
29 | /* | |
30 | * Initialize the potential user-provided clock plugin. | |
31 | */ | |
32 | lttng_ust_clock_init(); | |
df09bde5 | 33 | } |
cf914d16 MJ |
34 | |
35 | void lttng_ust_common_alloc_tls(void) | |
36 | { | |
37 | lttng_ust_fd_tracker_alloc_tls(); | |
38 | } |