X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libringbuffer%2Fring_buffer_frontend.c;h=45d46054cf45b2e6b4025a2f15e068068968a1f8;hb=5ea386c3b8e3566ec0b6710c82aae433de4d944a;hp=3cba68d4e7ef354b9d9ddd842378459fa975a4d1;hpb=a9ff648cc4cc06d28b522d705c467d45ab916a9d;p=lttng-ust.git diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c index 3cba68d4..45d46054 100644 --- a/libringbuffer/ring_buffer_frontend.c +++ b/libringbuffer/ring_buffer_frontend.c @@ -773,7 +773,8 @@ static void channel_free(struct channel *chan, * padding to let readers get those sub-buffers. * Used for live streaming. * @read_timer_interval: Time interval (in us) to wake up pending readers. - * @shm_path: Shared memory files path. + * @stream_fds: array of stream file descriptors. + * @nr_stream_fds: number of file descriptors in array. * * Holds cpu hotplug. * Returns NULL on failure. @@ -787,7 +788,7 @@ struct lttng_ust_shm_handle *channel_create(const struct lttng_ust_lib_ring_buff void *buf_addr, size_t subbuf_size, size_t num_subbuf, unsigned int switch_timer_interval, unsigned int read_timer_interval, - const char *shm_path) + const int *stream_fds, int nr_stream_fds) { int ret; size_t shmsize, chansize; @@ -801,6 +802,9 @@ struct lttng_ust_shm_handle *channel_create(const struct lttng_ust_lib_ring_buff else nr_streams = 1; + if (nr_stream_fds != nr_streams) + return NULL; + if (lib_ring_buffer_check_config(config, switch_timer_interval, read_timer_interval)) return NULL; @@ -825,7 +829,7 @@ struct lttng_ust_shm_handle *channel_create(const struct lttng_ust_lib_ring_buff /* Allocate normal memory for channel (not shared) */ shmobj = shm_object_table_alloc(handle->table, shmsize, SHM_OBJECT_MEM, - NULL); + -1); if (!shmobj) goto error_append; /* struct channel is at object 0, offset 0 (hardcoded) */ @@ -856,7 +860,7 @@ struct lttng_ust_shm_handle *channel_create(const struct lttng_ust_lib_ring_buff ret = channel_backend_init(&chan->backend, name, config, subbuf_size, num_subbuf, handle, - shm_path); + stream_fds); if (ret) goto error_backend_init;