Version 2.8.4
[lttng-ust.git] / liblttng-ust-ctl / ustctl.c
index fcb6f0d55c398f2cc534d7f8aa27c5f4e21b5657..d08e7edca67fa50e4feabb6d6c6d20f99521c66f 100644 (file)
@@ -33,6 +33,7 @@
 #include "../liblttng-ust/wait.h"
 #include "../liblttng-ust/lttng-rb-clients.h"
 #include "../liblttng-ust/clock.h"
+#include "../liblttng-ust/getenv.h"
 
 /*
  * Number of milliseconds to retry before failing metadata writes on
@@ -1725,6 +1726,23 @@ int ustctl_get_sequence_number(struct ustctl_consumer_stream *stream,
        return client_cb->sequence_number(buf, handle, seq);
 }
 
+int ustctl_get_instance_id(struct ustctl_consumer_stream *stream,
+               uint64_t *id)
+{
+       struct lttng_ust_client_lib_ring_buffer_client_cb *client_cb;
+       struct lttng_ust_lib_ring_buffer *buf;
+       struct lttng_ust_shm_handle *handle;
+
+       if (!stream || !id)
+               return -EINVAL;
+       buf = stream->buf;
+       handle = stream->chan->chan->handle;
+       client_cb = get_client_cb(buf, handle);
+       if (!client_cb)
+               return -ENOSYS;
+       return client_cb->instance_id(buf, handle, id);
+}
+
 #if defined(__x86_64__) || defined(__i386__)
 
 int ustctl_has_perf_counters(void)
@@ -2170,6 +2188,7 @@ static __attribute__((constructor))
 void ustctl_init(void)
 {
        init_usterr();
+       lttng_ust_getenv_init();        /* Needs init_usterr() to be completed. */
        lttng_ust_clock_init();
        lttng_ring_buffer_metadata_client_init();
        lttng_ring_buffer_client_overwrite_init();
This page took 0.024243 seconds and 4 git commands to generate.