if (strncmp(uchan->name, DEFAULT_METADATA_NAME,
sizeof(uchan->name))) {
lttng_ht_add_unique_str(usess->domain_global.channels, &uchan->node);
+ } else {
+ /*
+ * Copy channel attribute to session if this is metadata so if NO
+ * application exists we can access that data in the shadow copy during
+ * the global update of newly registered application.
+ */
+ memcpy(&usess->metadata_attr, &uchan->attr,
+ sizeof(usess->metadata_attr));
}
rcu_read_unlock();
lus->id = session_id;
lus->start_trace = 0;
+ /* Set default metadata channel attribute. */
+ lus->metadata_attr.overwrite = DEFAULT_CHANNEL_OVERWRITE;
+ lus->metadata_attr.subbuf_size = default_get_metadata_subbuf_size();
+ lus->metadata_attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM;
+ lus->metadata_attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER;
+ lus->metadata_attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER;
+ lus->metadata_attr.output = LTTNG_UST_MMAP;
+
/*
* Default buffer type. This can be changed through an enable channel
* requesting a different type. Note that this can only be changed once
unsigned int snapshot_mode;
unsigned int has_non_default_channel;
unsigned int live_timer_interval; /* usec */
+
+ /* Metadata channel attributes. */
+ struct lttng_ust_channel_attr metadata_attr;
};
/*
ua_sess->handle = -1;
ua_sess->channels = lttng_ht_new(0, LTTNG_HT_TYPE_STRING);
- pthread_mutex_init(&ua_sess->lock, NULL);
-
- /* Set default metadata channel attribute. */
- ua_sess->metadata_attr.overwrite = DEFAULT_CHANNEL_OVERWRITE;
- ua_sess->metadata_attr.subbuf_size = default_get_metadata_subbuf_size();
- ua_sess->metadata_attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM;
- ua_sess->metadata_attr.switch_timer_interval = DEFAULT_METADATA_SWITCH_TIMER;
- ua_sess->metadata_attr.read_timer_interval = DEFAULT_METADATA_READ_TIMER;
- ua_sess->metadata_attr.output = LTTNG_UST_MMAP;
ua_sess->metadata_attr.type = LTTNG_UST_CHAN_METADATA;
+ pthread_mutex_init(&ua_sess->lock, NULL);
return ua_sess;
ua_sess->consumer = usess->consumer;
ua_sess->output_traces = usess->output_traces;
ua_sess->live_timer_interval = usess->live_timer_interval;
+ copy_channel_attr_to_ustctl(&ua_sess->metadata_attr,
+ &usess->metadata_attr);
switch (ua_sess->buffer_type) {
case LTTNG_BUFFER_PER_PID: