Commit | Line | Data |
---|---|---|
7591bab1 MD |
1 | #ifndef LTTNG_RELAYD_H |
2 | #define LTTNG_RELAYD_H | |
3 | ||
b8aa1682 | 4 | /* |
ab5be9fa MJ |
5 | * Copyright (C) 2012 Julien Desfossez <jdesfossez@efficios.com> |
6 | * Copyright (C) 2012 David Goulet <dgoulet@efficios.com> | |
7 | * Copyright (C) 2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
b8aa1682 | 8 | * |
ab5be9fa | 9 | * SPDX-License-Identifier: GPL-2.0-only |
b8aa1682 | 10 | * |
b8aa1682 JD |
11 | */ |
12 | ||
d3e2ba59 | 13 | #include <limits.h> |
b8aa1682 | 14 | #include <urcu.h> |
8bdee6e2 | 15 | #include <urcu/wfcqueue.h> |
d3e2ba59 | 16 | |
8a00688e | 17 | #include <common/compat/poll.hpp> |
c9e313bc SM |
18 | #include <common/hashtable/hashtable.hpp> |
19 | #include <common/fd-tracker/fd-tracker.hpp> | |
d3e2ba59 | 20 | |
23c8ff50 JG |
21 | struct sessiond_trace_chunk_registry; |
22 | ||
b8aa1682 JD |
23 | /* |
24 | * Queue used to enqueue relay requests | |
25 | */ | |
58eb9381 | 26 | struct relay_conn_queue { |
8bdee6e2 SM |
27 | struct cds_wfcq_head head; |
28 | struct cds_wfcq_tail tail; | |
7717e361 | 29 | int32_t futex; |
b8aa1682 JD |
30 | }; |
31 | ||
a8b66566 JR |
32 | enum relay_group_output_by { |
33 | RELAYD_GROUP_OUTPUT_BY_UNKNOWN, | |
34 | RELAYD_GROUP_OUTPUT_BY_HOST, | |
35 | RELAYD_GROUP_OUTPUT_BY_SESSION, | |
36 | }; | |
37 | ||
2a174661 DG |
38 | /* |
39 | * Contains stream indexed by ID. This is important since many commands lookup | |
40 | * streams only by ID thus also keeping them in this hash table makes the | |
7591bab1 | 41 | * search O(1). |
2a174661 | 42 | */ |
7591bab1 | 43 | extern struct lttng_ht *sessions_ht; |
d3e2ba59 | 44 | extern struct lttng_ht *relay_streams_ht; |
92c6ca54 | 45 | extern struct lttng_ht *viewer_streams_ht; |
23c8ff50 | 46 | extern struct sessiond_trace_chunk_registry *sessiond_trace_chunk_registry; |
d3e2ba59 | 47 | |
7591bab1 | 48 | extern char *opt_output_path; |
65931c8b | 49 | extern const char *tracing_group_name; |
cd60b05a | 50 | extern const char * const config_section_name; |
a8b66566 | 51 | extern enum relay_group_output_by opt_group_output_by; |
cd60b05a | 52 | |
00e3b7f1 JG |
53 | extern struct fd_tracker *the_fd_tracker; |
54 | ||
3fd27398 | 55 | void lttng_relay_notify_ready(void); |
b4aacfdc | 56 | int lttng_relay_stop_threads(void); |
d3e2ba59 | 57 | |
8a00688e MJ |
58 | int relayd_init_thread_quit_pipe(void); |
59 | int relayd_notify_thread_quit_pipe(void); | |
60 | void relayd_close_thread_quit_pipe(void); | |
61 | bool relayd_is_thread_quit_pipe(const int fd); | |
62 | ||
63 | int create_named_thread_poll_set(struct lttng_poll_event *events, | |
64 | int size, const char *name); | |
65 | ||
7717e361 | 66 | #endif /* LTTNG_RELAYD_H */ |