kref_init(&metadata_cache->refcount);
session->metadata_cache = metadata_cache;
INIT_LIST_HEAD(&metadata_cache->metadata_stream);
+ memcpy(&metadata_cache->uuid, &session->uuid,
+ sizeof(metadata_cache->uuid));
list_add(&session->list, &sessions);
mutex_unlock(&sessions_mutex);
return session;
unsigned int metadata_written; /* Number of bytes written in metadata cache */
struct kref refcount; /* Metadata cache usage */
struct list_head metadata_stream; /* Metadata stream list */
+ uuid_le uuid; /* Trace session unique ID (copy) */
};
struct lttng_session *lttng_session_create(void);
(struct metadata_packet_header *)
lib_ring_buffer_offset_address(&buf->backend,
subbuf_idx * chan->backend.subbuf_size);
- struct lttng_channel *lttng_chan = channel_get_private(chan);
- struct lttng_session *session = lttng_chan->session;
+ struct lttng_metadata_cache *metadata_cache =
+ channel_get_private(chan);
header->magic = TSDL_MAGIC_NUMBER;
- memcpy(header->uuid, session->uuid.b, sizeof(session->uuid));
+ memcpy(header->uuid, metadata_cache->uuid.b,
+ sizeof(metadata_cache->uuid));
header->checksum = 0; /* 0 if unused */
header->content_size = 0xFFFFFFFF; /* in bits, for debugging */
header->packet_size = 0xFFFFFFFF; /* in bits, for debugging */
{
struct channel *chan;
- chan = channel_create(&client_config, name, lttng_chan, buf_addr,
+ chan = channel_create(&client_config, name,
+ lttng_chan->session->metadata_cache, buf_addr,
subbuf_size, num_subbuf, switch_timer_interval,
read_timer_interval);
if (chan) {