Move the getcpu plugin implementation to liblttn-ust-common
[lttng-ust.git] / src / lib / lttng-ust-common / ust-common.c
CommitLineData
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"
f73bcf5e 15#include "lib/lttng-ust-common/getcpu.h"
df09bde5 16
fca97dfd
MJ
17/*
18 * The liblttng-ust-common constructor, initialize the internal shared state.
19 * Libraries linking on liblttng-ust-common should also call this early in
20 * their constructor since there is no reliable way to guarantee the execution
21 * order of constructors across shared library.
22 */
23void lttng_ust_common_ctor(void)
df09bde5 24{
df09bde5 25 /*
fca97dfd 26 * Initialize the shared state of the fd tracker.
df09bde5 27 */
fca97dfd 28 lttng_ust_fd_tracker_init();
f41a6b5f
MJ
29
30 /*
31 * Initialize the potential user-provided clock plugin.
32 */
33 lttng_ust_clock_init();
f73bcf5e
MJ
34
35 /*
36 * Initialize the potential user-provided getcpu plugin.
37 */
38 lttng_ust_getcpu_plugin_init();
df09bde5 39}
cf914d16
MJ
40
41void lttng_ust_common_alloc_tls(void)
42{
43 lttng_ust_fd_tracker_alloc_tls();
44}
This page took 0.024321 seconds and 4 git commands to generate.