X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fctf-trace.c;h=ab1610929aa5da6e0424749ee9c28eb968356fc7;hb=198d75caf085937dec0aca154e899ea574f9295d;hp=6fe77a5b4438f5833e9eaa9bfeb3c092aaacf964;hpb=2a174661a1e0ab551b41ff1cae7191688525fc1f;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/ctf-trace.c b/src/bin/lttng-relayd/ctf-trace.c index 6fe77a5b4..ab1610929 100644 --- a/src/bin/lttng-relayd/ctf-trace.c +++ b/src/bin/lttng-relayd/ctf-trace.c @@ -38,6 +38,14 @@ static void rcu_destroy_ctf_trace(struct rcu_head *head) free(trace); } +static void rcu_destroy_stream(struct rcu_head *head) +{ + struct relay_stream *stream = + caa_container_of(head, struct relay_stream, rcu_node); + + stream_destroy(stream); +} + /* * Destroy a ctf trace and all stream contained in it. * @@ -57,7 +65,7 @@ void ctf_trace_destroy(struct ctf_trace *obj) cds_list_for_each_entry_safe(stream, tmp_stream, &obj->stream_list, trace_list) { stream_delete(relay_streams_ht, stream); - stream_destroy(stream); + call_rcu(&stream->rcu_node, rcu_destroy_stream); } call_rcu(&obj->node.head, rcu_destroy_ctf_trace); @@ -75,6 +83,7 @@ void ctf_trace_try_destroy(struct relay_session *session, */ if (uatomic_read(&session->viewer_refcount) == 0 && uatomic_read(&ctf_trace->refcount) == 0) { + ctf_trace_delete(session->ctf_traces_ht, ctf_trace); ctf_trace_destroy(ctf_trace); } }