2 * Copyright (C) 2013 - Julien Desfossez <jdesfossez@efficios.com>
3 * David Goulet <dgoulet@efficios.com>
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License, version 2 only, as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 51
16 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #include <common/hashtable/hashtable.h>
31 unsigned int invalid_flag
:1;
33 uint64_t metadata_received
;
34 uint64_t metadata_sent
;
35 struct relay_stream
*metadata_stream
;
36 struct relay_viewer_stream
*viewer_metadata_stream
;
37 /* Node indexed by stream path name in the corresponding session. */
38 struct lttng_ht_node_str node
;
40 /* Relay stream associated with this ctf trace. */
41 struct cds_list_head stream_list
;
44 static inline void ctf_trace_get_ref(struct ctf_trace
*trace
)
46 uatomic_inc(&trace
->refcount
);
49 static inline void ctf_trace_put_ref(struct ctf_trace
*trace
)
51 uatomic_add(&trace
->refcount
, -1);
54 void ctf_trace_assign(struct relay_stream
*stream
);
55 struct ctf_trace
*ctf_trace_create(char *path_name
);
56 void ctf_trace_destroy(struct ctf_trace
*obj
);
57 void ctf_trace_try_destroy(struct relay_session
*session
,
58 struct ctf_trace
*ctf_trace
);
59 struct ctf_trace
*ctf_trace_find_by_path(struct lttng_ht
*ht
,
61 void ctf_trace_add(struct lttng_ht
*ht
, struct ctf_trace
*trace
);
62 void ctf_trace_delete(struct lttng_ht
*ht
, struct ctf_trace
*trace
);
64 #endif /* _CTF_TRACE_H */