X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fctf-trace.c;h=02a8b2bf16e6b553ccd6d4059c88634aa42bd49d;hb=0c0e3b4112d52fb54a844300b36f1373e3055c8f;hp=59946ea4a8810bde2edc67414d782f34fc4032cb;hpb=6c1c0768320135c6936c371b09731851b508c023;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/ctf-trace.c b/src/bin/lttng-relayd/ctf-trace.c index 59946ea4a..02a8b2bf1 100644 --- a/src/bin/lttng-relayd/ctf-trace.c +++ b/src/bin/lttng-relayd/ctf-trace.c @@ -39,6 +39,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. * @@ -58,7 +66,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); @@ -109,6 +117,8 @@ error: /* * Return a ctf_trace object if found by id in the given hash table else NULL. + * + * Must be called with rcu_read_lock() taken. */ struct ctf_trace *ctf_trace_find_by_path(struct lttng_ht *ht, char *path_name)