Refactor JUL to agent namespace
[lttng-tools.git] / src / bin / lttng-sessiond / lttng-sessiond.h
CommitLineData
8c0faa1d
DG
1/*
2 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
88564da0 3 * Copyright (C) 2013 - Raphaël Beamonte <raphael.beamonte@gmail.com>
fac6795d 4 *
d14d33bf
AM
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License, version 2 only,
7 * as published by the Free Software Foundation.
8c0faa1d 8 *
fac6795d
DG
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d14d33bf 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
fac6795d 12 * GNU General Public License for more details.
8c0faa1d 13 *
d14d33bf
AM
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
fac6795d
DG
17 */
18
19#ifndef _LTT_SESSIOND_H
20#define _LTT_SESSIOND_H
21
099e26bd 22#define _LGPL_SOURCE
f6a9efaa 23#include <urcu.h>
8bdee6e2 24#include <urcu/wfcqueue.h>
099e26bd 25
10a8a223 26#include <common/sessiond-comm/sessiond-comm.h>
d0b96690 27#include <common/compat/poll.h>
730389d9 28#include <common/compat/socket.h>
10a8a223
DG
29
30#include "session.h"
56fff090 31#include "ust-app.h"
88564da0 32#include "version.h"
099e26bd 33
686204ab
MD
34extern const char default_home_dir[],
35 default_tracing_group[],
36 default_ust_sock_dir[],
37 default_global_apps_pipe[];
fac6795d 38
2f77fc4b
DG
39/* Set in main.c at boot time of the daemon */
40extern int kernel_tracer_fd;
41
5461b305
DG
42/*
43 * This contains extra data needed for processing a command received by the
44 * session daemon from the lttng client.
45 */
46struct command_ctx {
47 int ust_sock;
48 unsigned int lttng_msg_size;
49 struct ltt_session *session;
50 struct lttcomm_lttng_msg *llm;
51 struct lttcomm_session_msg *lsm;
730389d9 52 lttng_sock_cred creds;
5461b305
DG
53};
54
099e26bd
DG
55struct ust_command {
56 int sock;
57 struct ust_register_msg reg_msg;
8bdee6e2 58 struct cds_wfcq_node node;
099e26bd
DG
59};
60
61/*
62 * Queue used to enqueue UST registration request (ust_commant) and protected
63 * by a futex with a scheme N wakers / 1 waiters. See futex.c/.h
64 */
65struct ust_cmd_queue {
66 int32_t futex;
8bdee6e2
SM
67 struct cds_wfcq_head head;
68 struct cds_wfcq_tail tail;
099e26bd
DG
69};
70
f45e313d
DG
71/*
72 * This is the wait queue containing wait nodes during the application
73 * registration process.
74 */
75struct ust_reg_wait_queue {
76 unsigned long count;
77 struct cds_list_head head;
78};
79
80/*
81 * Use by the dispatch registration to queue UST command socket to wait for the
82 * notify socket.
83 */
84struct ust_reg_wait_node {
85 struct ust_app *app;
86 struct cds_list_head head;
87};
88
d0b96690
DG
89/*
90 * This pipe is used to inform the thread managing application notify
91 * communication that a command is queued and ready to be processed.
92 */
93extern int apps_cmd_notify_pipe[2];
94
0b2dc8df
MD
95/*
96 * Used to notify that a hash table needs to be destroyed by dedicated
97 * thread. Required by design because we don't want to move destroy
98 * paths outside of large RCU read-side lock paths, and destroy cannot
99 * be called by call_rcu thread, because it may hang (waiting for
100 * call_rcu completion).
101 */
102extern int ht_cleanup_pipe[2];
103
12744796
DG
104/*
105 * Populated when the daemon starts with the current page size of the system.
106 */
107extern long page_size;
108
4d076222 109/*
022d91ba 110 * Global set once in main(). Agent TCP port for registration.
4d076222 111 */
022d91ba 112extern unsigned int agent_tcp_port;
4d076222 113
26296c48
JG
114/*
115 * Section name to look for in the daemon configuration file.
116 */
117extern const char * const config_section_name;
118
f43f95a9
DG
119/* Is this daemon root or not. */
120extern int is_root;
121
d0b96690
DG
122int sessiond_set_thread_pollset(struct lttng_poll_event *events, size_t size);
123int sessiond_check_thread_quit_pipe(int fd, uint32_t events);
124
0b2dc8df
MD
125void *thread_ht_cleanup(void *data);
126
ef367a93
JG
127void sessiond_notify_ready(void);
128
fac6795d 129#endif /* _LTT_SESSIOND_H */
This page took 0.055144 seconds and 5 git commands to generate.