sessiond: clarify the role of notification credentials
[lttng-tools.git] / src / bin / lttng-relayd / ctf-trace.h
CommitLineData
7591bab1
MD
1#ifndef _CTF_TRACE_H
2#define _CTF_TRACE_H
3
d3e2ba59 4/*
ab5be9fa
MJ
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>
d3e2ba59 8 *
ab5be9fa 9 * SPDX-License-Identifier: GPL-2.0-only
d3e2ba59 10 *
d3e2ba59
JD
11 */
12
d3e2ba59 13#include <inttypes.h>
7591bab1 14#include <urcu/ref.h>
d3e2ba59
JD
15
16#include <common/hashtable/hashtable.h>
17
2a174661 18#include "session.h"
58eb9381 19#include "stream.h"
7591bab1 20#include "viewer-stream.h"
d3e2ba59
JD
21
22struct ctf_trace {
7591bab1
MD
23 struct urcu_ref ref; /* Every stream has a ref on the trace. */
24 struct relay_session *session; /* Back ref to trace session */
25
348a81dc
JG
26 /* Trace sub-folder relative to the session output path. */
27 char *path;
348a81dc 28
7591bab1
MD
29 /*
30 * The ctf_trace lock nests inside the session lock.
31 */
32 pthread_mutex_t lock;
d3e2ba59 33 uint64_t id;
7591bab1 34 struct relay_viewer_stream *viewer_metadata_stream; /* RCU protected */
2a174661 35
7591bab1
MD
36 /*
37 * Relay streams associated with this ctf trace.
38 * Updates are protected by the stream_list lock.
39 * Traversals are protected by RCU.
40 */
2a174661 41 struct cds_list_head stream_list;
7591bab1
MD
42 pthread_mutex_t stream_list_lock;
43
44 /*
45 * Node within session trace hash table. Node is indexed by
46 * stream path name.
47 */
48 struct lttng_ht_node_str node;
49 struct rcu_head rcu_node; /* For call_rcu teardown. */
123ed7c2
FD
50
51 /*
52 * True if the metadata stream of this trace was sent the viewer in the
53 * past.
54 */
55 bool metadata_stream_sent_to_viewer;
d3e2ba59
JD
56};
57
7591bab1 58struct ctf_trace *ctf_trace_get_by_path_or_create(struct relay_session *session,
348a81dc 59 const char *subpath);
7591bab1
MD
60bool ctf_trace_get(struct ctf_trace *trace);
61void ctf_trace_put(struct ctf_trace *trace);
2a174661 62
7591bab1 63int ctf_trace_close(struct ctf_trace *trace);
2a174661 64
7591bab1 65struct relay_viewer_stream *ctf_trace_get_viewer_metadata_stream(struct ctf_trace *trace);
d3e2ba59
JD
66
67#endif /* _CTF_TRACE_H */
This page took 0.044451 seconds and 4 git commands to generate.