5 * Copyright (C) 2013 - Julien Desfossez <jdesfossez@efficios.com>
6 * David Goulet <dgoulet@efficios.com>
7 * 2015 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License, version 2 only, as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 * You should have received a copy of the GNU General Public License along with
19 * this program; if not, write to the Free Software Foundation, Inc., 51
20 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #include <common/hashtable/hashtable.h>
30 #include "viewer-stream.h"
33 struct urcu_ref ref
; /* Every stream has a ref on the trace. */
34 struct relay_session
*session
; /* Back ref to trace session */
36 /* Trace sub-folder relative to the session output path. */
40 * The ctf_trace lock nests inside the session lock.
44 struct relay_viewer_stream
*viewer_metadata_stream
; /* RCU protected */
47 * Relay streams associated with this ctf trace.
48 * Updates are protected by the stream_list lock.
49 * Traversals are protected by RCU.
51 struct cds_list_head stream_list
;
52 pthread_mutex_t stream_list_lock
;
55 * Node within session trace hash table. Node is indexed by
58 struct lttng_ht_node_str node
;
59 struct rcu_head rcu_node
; /* For call_rcu teardown. */
62 * True if the metadata stream of this trace was sent the viewer in the
65 bool metadata_stream_sent_to_viewer
;
68 struct ctf_trace
*ctf_trace_get_by_path_or_create(struct relay_session
*session
,
70 bool ctf_trace_get(struct ctf_trace
*trace
);
71 void ctf_trace_put(struct ctf_trace
*trace
);
73 int ctf_trace_close(struct ctf_trace
*trace
);
75 struct relay_viewer_stream
*ctf_trace_get_viewer_metadata_stream(struct ctf_trace
*trace
);
77 #endif /* _CTF_TRACE_H */