-static
-void *lttng_ust_baddr_handle(void)
-{
- if (!ust_baddr_handle) {
- ust_baddr_handle = dlopen(
- "liblttng-ust-baddr.so.0", RTLD_NOW | RTLD_GLOBAL);
- if (ust_baddr_handle == NULL)
- ERR("%s", dlerror());
- }
- return ust_baddr_handle;
-}
-
-static
-int lttng_ust_baddr_statedump(struct lttng_session *session)
-{
- static
- int (*lttng_ust_baddr_init_fn)(struct lttng_session *);
-
- if (!lttng_ust_baddr_init_fn) {
- void *baddr_handle = lttng_ust_baddr_handle();
- if (baddr_handle) {
- lttng_ust_baddr_init_fn = dlsym(baddr_handle,
- "lttng_ust_baddr_statedump");
- if (lttng_ust_baddr_init_fn == NULL)
- ERR("%s", dlerror());
- }
- if (!lttng_ust_baddr_init_fn)
- return -1;
- }
-
- return lttng_ust_baddr_init_fn(session);
-}
-