*/
#define _GNU_SOURCE
+#define _LGPL_SOURCE
#include <assert.h>
#include <common/common.h>
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.
*
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);
*/
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);
}
}
/*
* 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)