X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=src%2Flib%2Flttng-ust-common%2Fust-common.c;fp=src%2Flib%2Flttng-ust-common%2Fust-common.c;h=e163383d2b458bca3b9386f91b680cb0da825ea9;hb=fca97dfd73a96bbf964c39e7f3a21fe70cccee96;hp=cefff67a82d721d0c63c6940e86563ed9cf53c38;hpb=39313bf35301f186b2517e05e0bda38e138e868c;p=lttng-ust.git diff --git a/src/lib/lttng-ust-common/ust-common.c b/src/lib/lttng-ust-common/ust-common.c index cefff67a..e163383d 100644 --- a/src/lib/lttng-ust-common/ust-common.c +++ b/src/lib/lttng-ust-common/ust-common.c @@ -4,18 +4,24 @@ * Copyright (C) 2021 Michael Jeanson */ +#include + #include "common/logging.h" #include "common/ust-fd.h" +#include "common/getenv.h" + +#include "lib/lttng-ust-common/fd-tracker.h" -static -void lttng_ust_common_init(void) - __attribute__((constructor)); -static -void lttng_ust_common_init(void) +/* + * The liblttng-ust-common constructor, initialize the internal shared state. + * Libraries linking on liblttng-ust-common should also call this early in + * their constructor since there is no reliable way to guarantee the execution + * order of constructors across shared library. + */ +void lttng_ust_common_ctor(void) { /* - * Initialize the fd-tracker, other libraries using it should also call - * this in their constructor in case it gets executed before this one. + * Initialize the shared state of the fd tracker. */ - lttng_ust_init_fd_tracker(); + lttng_ust_fd_tracker_init(); }