X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fstream.c;h=8825d094ce57b389662667bfd5d567ca0ed77cfd;hp=cac87635ed46c2044f72c44e0e99940c6af1af17;hb=49e614cb2878f0664c9f44f9f24cb1d81116de21;hpb=3d07a857948f868354589ff742b0a2f6277f558f diff --git a/src/bin/lttng-relayd/stream.c b/src/bin/lttng-relayd/stream.c index cac87635e..8825d094c 100644 --- a/src/bin/lttng-relayd/stream.c +++ b/src/bin/lttng-relayd/stream.c @@ -253,6 +253,11 @@ static void stream_unpublish(struct relay_stream *stream) static void stream_destroy(struct relay_stream *stream) { if (stream->indexes_ht) { + /* + * Calling lttng_ht_destroy in call_rcu worker thread so + * we don't hold the RCU read-side lock while calling + * it. + */ lttng_ht_destroy(stream->indexes_ht); } if (stream->tfa) { @@ -416,6 +421,27 @@ void try_stream_close(struct relay_stream *stream) stream_put(stream); } +static void print_stream_indexes(struct relay_stream *stream) +{ + struct lttng_ht_iter iter; + struct relay_index *index; + + rcu_read_lock(); + cds_lfht_for_each_entry(stream->indexes_ht->ht, &iter.iter, index, + index_n.node) { + DBG("index %p net_seq_num %" PRIu64 " refcount %ld" + " stream %" PRIu64 " trace %" PRIu64 + " session %" PRIu64, + index, + index->index_n.key, + stream->ref.refcount, + index->stream->stream_handle, + index->stream->trace->id, + index->stream->trace->session->id); + } + rcu_read_unlock(); +} + void print_relay_streams(void) { struct lttng_ht_iter iter; @@ -434,6 +460,7 @@ void print_relay_streams(void) stream->stream_handle, stream->trace->id, stream->trace->session->id); + print_stream_indexes(stream); stream_put(stream); } rcu_read_unlock();