X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fkernel.c;h=24666f968d61da9b755eb0df52c31eb465de8158;hb=df09ff2e14eeef441e1031cbfcea0114cab9bc2d;hp=a9151f4d6ffae2a4b56f7ea652b4058b408a37b5;hpb=faa9eb177c4495e95483c893a0ef871e3749a730;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/kernel.c b/src/bin/lttng-sessiond/kernel.c index a9151f4d6..24666f968 100644 --- a/src/bin/lttng-sessiond/kernel.c +++ b/src/bin/lttng-sessiond/kernel.c @@ -793,6 +793,7 @@ void kernel_destroy_session(struct ltt_kernel_session *ksess) struct lttng_ht_iter iter; /* For each consumer socket. */ + rcu_read_lock(); cds_lfht_for_each_entry(ksess->consumer->socks->ht, &iter.iter, socket, node.node) { struct ltt_kernel_channel *chan; @@ -806,6 +807,7 @@ void kernel_destroy_session(struct ltt_kernel_session *ksess) } } } + rcu_read_unlock(); } /* Close any relayd session */ @@ -850,7 +852,8 @@ void kernel_destroy_channel(struct ltt_kernel_channel *kchan) * Return 0 on success or else return a LTTNG_ERR code. */ int kernel_snapshot_record(struct ltt_kernel_session *ksess, - struct snapshot_output *output, int wait, uint64_t max_size_per_stream) + struct snapshot_output *output, int wait, + uint64_t nb_packets_per_stream) { int err, ret, saved_metadata_fd; struct consumer_socket *socket; @@ -911,7 +914,7 @@ int kernel_snapshot_record(struct ltt_kernel_session *ksess, ret = consumer_snapshot_channel(socket, chan->fd, output, 0, ksess->uid, ksess->gid, DEFAULT_KERNEL_TRACE_DIR, wait, - max_size_per_stream); + nb_packets_per_stream); pthread_mutex_unlock(socket->lock); if (ret < 0) { ret = LTTNG_ERR_KERN_CONSUMER_FAIL; @@ -925,7 +928,7 @@ int kernel_snapshot_record(struct ltt_kernel_session *ksess, pthread_mutex_lock(socket->lock); ret = consumer_snapshot_channel(socket, ksess->metadata->fd, output, 1, ksess->uid, ksess->gid, - DEFAULT_KERNEL_TRACE_DIR, wait, max_size_per_stream); + DEFAULT_KERNEL_TRACE_DIR, wait, 0); pthread_mutex_unlock(socket->lock); if (ret < 0) { ret = LTTNG_ERR_KERN_CONSUMER_FAIL;