unsigned int switch_timer_interval; /* usec */
unsigned int read_timer_interval; /* usec */
enum lttng_ust_output output; /* splice, mmap */
+ uint32_t chan_id; /* channel ID */
unsigned char uuid[LTTNG_UST_UUID_LEN]; /* Trace session unique ID */
} LTTNG_PACKED;
size_t subbuf_size, size_t num_subbuf,
unsigned int switch_timer_interval,
unsigned int read_timer_interval,
- unsigned char *uuid);
+ unsigned char *uuid,
+ uint32_t chan_id);
void (*channel_destroy)(struct lttng_channel *chan);
int (*event_reserve)(struct lttng_ust_lib_ring_buffer_ctx *ctx,
uint32_t event_id);
attr->subbuf_size, attr->num_subbuf,
attr->switch_timer_interval,
attr->read_timer_interval,
- attr->uuid);
+ attr->uuid, attr->chan_id);
if (!chan->chan) {
goto chan_error;
}
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)
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" */
size_t subbuf_size, size_t num_subbuf,
unsigned int switch_timer_interval,
unsigned int read_timer_interval,
- unsigned char *uuid)
+ unsigned char *uuid,
+ uint32_t chan_id)
{
struct lttng_channel chan_priv_init;
struct lttng_ust_shm_handle *handle;
memset(&chan_priv_init, 0, sizeof(chan_priv_init));
memcpy(chan_priv_init.uuid, uuid, LTTNG_UST_UUID_LEN);
+ chan_priv_init.id = chan_id;
handle = channel_create(&client_config, name,
&priv, __alignof__(*lttng_chan), sizeof(*lttng_chan),
&chan_priv_init,
size_t subbuf_size, size_t num_subbuf,
unsigned int switch_timer_interval,
unsigned int read_timer_interval,
- unsigned char *uuid)
+ unsigned char *uuid,
+ uint32_t chan_id)
{
struct lttng_channel chan_priv_init;
struct lttng_ust_shm_handle *handle;
memset(&chan_priv_init, 0, sizeof(chan_priv_init));
memcpy(chan_priv_init.uuid, uuid, LTTNG_UST_UUID_LEN);
+ chan_priv_init.id = chan_id;
handle = channel_create(&client_config, name,
&priv, __alignof__(*lttng_chan), sizeof(*lttng_chan),
&chan_priv_init,