5 * Copyright (C) 2013 Julien Desfossez <jdesfossez@efficios.com>
6 * Copyright (C) 2013 David Goulet <dgoulet@efficios.com>
7 * Copyright (C) 2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 * SPDX-License-Identifier: GPL-2.0-only
16 #include <common/hashtable/hashtable.h>
20 #include "viewer-stream.h"
23 struct urcu_ref ref
; /* Every stream has a ref on the trace. */
24 struct relay_session
*session
; /* Back ref to trace session */
26 /* Trace sub-folder relative to the session output path. */
30 * The ctf_trace lock nests inside the session lock.
34 struct relay_viewer_stream
*viewer_metadata_stream
; /* RCU protected */
37 * Relay streams associated with this ctf trace.
38 * Updates are protected by the stream_list lock.
39 * Traversals are protected by RCU.
41 struct cds_list_head stream_list
;
42 pthread_mutex_t stream_list_lock
;
45 * Node within session trace hash table. Node is indexed by
48 struct lttng_ht_node_str node
;
49 struct rcu_head rcu_node
; /* For call_rcu teardown. */
52 * True if the metadata stream of this trace was sent the viewer in the
55 bool metadata_stream_sent_to_viewer
;
58 struct ctf_trace
*ctf_trace_get_by_path_or_create(struct relay_session
*session
,
60 bool ctf_trace_get(struct ctf_trace
*trace
);
61 void ctf_trace_put(struct ctf_trace
*trace
);
63 int ctf_trace_close(struct ctf_trace
*trace
);
65 struct relay_viewer_stream
*ctf_trace_get_viewer_metadata_stream(struct ctf_trace
*trace
);
67 #endif /* _CTF_TRACE_H */