Add channel ID field to attr
[lttng-ust.git] / liblttng-ust / lttng-events.c
index b6e2ab3972a2c135f9957340f1c9845869c02696..d5597ca6d787ac4470538231e4a355649ac7e564 100644 (file)
@@ -262,6 +262,7 @@ int lttng_session_enable(struct lttng_session *session)
                const struct lttng_ctx *ctx;
                const struct lttng_event_field *fields = NULL;
                size_t nr_fields = 0;
+               uint32_t chan_id;
 
                /* don't change it if session stop/restart */
                if (chan->header_type)
@@ -276,12 +277,17 @@ int lttng_session_enable(struct lttng_session *session)
                        chan->objd,
                        nr_fields,
                        fields,
-                       &chan->id,
+                       &chan_id,
                        &chan->header_type);
                if (ret) {
                        DBG("Error (%d) registering channel to sessiond", ret);
                        return ret;
                }
+               if (chan_id != chan->id) {
+                       DBG("Error: channel registration id (%u) does not match id assigned at creation (%u)",
+                               chan_id, chan->id);
+                       return -EINVAL;
+               }
        }
 
        /* Set atomically the state to "active" */
@@ -440,7 +446,7 @@ int lttng_desc_match_wildcard_enabler(const struct lttng_event_desc *desc,
                struct lttng_enabler *enabler)
 {
        int loglevel = 0;
-       unsigned int has_loglevel;
+       unsigned int has_loglevel = 0;
 
        assert(enabler->type == LTTNG_ENABLER_WILDCARD);
        /* Compare excluding final '*' */
This page took 0.024321 seconds and 4 git commands to generate.