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;
+
+}
goto alloc_error;
}
+ if (lttng_ust_session_uuid_validate(session, lttng_chan_config->uuid)) {
+ ret = -EINVAL;
+ goto uuid_error;
+ }
+
/* Lookup transport name */
switch (type) {
case LTTNG_UST_ABI_CHAN_PER_CPU:
/* error path after channel was created */
objd_error:
notransport:
+uuid_error:
alloc_error:
channel_destroy(chan, channel_handle, 0);
lttng_ust_free_channel_common(lttng_chan_buf->parent);
struct lttng_ust_enum_ht enums_ht; /* ht of enumerations */
struct cds_list_head enums_head;
struct lttng_ust_ctx *ctx; /* contexts for filters. */
+
+ unsigned char uuid[LTTNG_UST_UUID_LEN]; /* Trace session unique ID */
+ bool uuid_set; /* Is uuid set ? */
};
struct lttng_enum {
const char *interpreter_stack_data,
void *filter_ctx);
+__attribute__((visibility("hidden")))
+int lttng_ust_session_uuid_validate(struct lttng_ust_session *session,
+ unsigned char *uuid);
+
#endif /* _LTTNG_UST_EVENTS_INTERNAL_H */