Add channel ID field to attr
[lttng-ust.git] / liblttng-ust / lttng-events.c
index 78a4f7603de5003fc6af44f47feafdc9d887b669..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" */
This page took 0.024598 seconds and 4 git commands to generate.