API cleanup: Remove handle from struct lttng_ust_channel_buffer
[lttng-ust.git] / liblttng-ust / lttng-events.c
index 9c65dc4544ffb85fb94bf6552ff7b851c063b2ee..e489357421c92e3a4c3a0500451ca2daab746194 100644 (file)
@@ -53,6 +53,7 @@
 #include "ust-events-internal.h"
 #include "wait.h"
 #include "../libringbuffer/shm.h"
+#include "../libringbuffer/frontend_types.h"
 #include "../libcounter/counter.h"
 #include "jhash.h"
 #include <lttng/ust-abi.h>
@@ -238,7 +239,7 @@ void _lttng_channel_unmap(struct lttng_ust_channel_buffer *lttng_chan)
        cds_list_del(&lttng_chan->priv->node);
        lttng_destroy_context(lttng_chan->priv->ctx);
        chan = lttng_chan->chan;
-       handle = lttng_chan->handle;
+       handle = chan->handle;
        channel_destroy(chan, handle, 0);
        free(lttng_chan->parent);
        free(lttng_chan->priv);
@@ -2019,3 +2020,21 @@ void lttng_ust_context_set_event_notifier_group_provider(const char *name,
                        abort();
        }
 }
+
+int lttng_ust_session_uuid_validate(struct lttng_ust_session *session,
+               unsigned char *uuid)
+{
+       if (!session)
+               return 0;
+       /* Compare UUID with session. */
+       if (session->priv->uuid_set) {
+               if (memcmp(session->priv->uuid, uuid, LTTNG_UST_UUID_LEN)) {
+                       return -1;
+               }
+       } else {
+               memcpy(session->priv->uuid, uuid, LTTNG_UST_UUID_LEN);
+               session->priv->uuid_set = true;
+       }
+       return 0;
+
+}
This page took 0.024128 seconds and 4 git commands to generate.