Stop rotation pending check timer from the rotation thread
[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
f6a9efaa 22#include <urcu.h>
8bdee6e2 23#include <urcu/wfcqueue.h>
099e26bd 24
10a8a223 25#include <common/sessiond-comm/sessiond-comm.h>
d0b96690 26#include <common/compat/poll.h>
730389d9 27#include <common/compat/socket.h>
10a8a223
DG
28
29#include "session.h"
56fff090 30#include "ust-app.h"
e9404c27 31#include "notification-thread.h"
e6142f2e 32#include "sessiond-config.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
a7333da7 42/* Notification thread handle. */
e9404c27
JG
43extern struct notification_thread_handle *notification_thread_handle;
44
5461b305
DG
45/*
46 * This contains extra data needed for processing a command received by the
47 * session daemon from the lttng client.
48 */
49struct command_ctx {
50 int ust_sock;
51 unsigned int lttng_msg_size;
52 struct ltt_session *session;
53 struct lttcomm_lttng_msg *llm;
54 struct lttcomm_session_msg *lsm;
730389d9 55 lttng_sock_cred creds;
5461b305
DG
56};
57
099e26bd
DG
58struct ust_command {
59 int sock;
60 struct ust_register_msg reg_msg;
8bdee6e2 61 struct cds_wfcq_node node;
099e26bd
DG
62};
63
64/*
7a44d6f1 65 * Queue used to enqueue UST registration request (ust_command) and synchronized
099e26bd
DG
66 * by a futex with a scheme N wakers / 1 waiters. See futex.c/.h
67 */
68struct ust_cmd_queue {
69 int32_t futex;
8bdee6e2
SM
70 struct cds_wfcq_head head;
71 struct cds_wfcq_tail tail;
099e26bd
DG
72};
73
f45e313d
DG
74/*
75 * This is the wait queue containing wait nodes during the application
76 * registration process.
77 */
78struct ust_reg_wait_queue {
79 unsigned long count;
80 struct cds_list_head head;
81};
82
83/*
84 * Use by the dispatch registration to queue UST command socket to wait for the
85 * notify socket.
86 */
87struct ust_reg_wait_node {
88 struct ust_app *app;
89 struct cds_list_head head;
90};
91
d0b96690
DG
92/*
93 * This pipe is used to inform the thread managing application notify
94 * communication that a command is queued and ready to be processed.
95 */
96extern int apps_cmd_notify_pipe[2];
97
0b2dc8df
MD
98/*
99 * Used to notify that a hash table needs to be destroyed by dedicated
100 * thread. Required by design because we don't want to move destroy
101 * paths outside of large RCU read-side lock paths, and destroy cannot
102 * be called by call_rcu thread, because it may hang (waiting for
103 * call_rcu completion).
104 */
105extern int ht_cleanup_pipe[2];
106
e32d7f27
JG
107extern int kernel_poll_pipe[2];
108
12744796
DG
109/*
110 * Populated when the daemon starts with the current page size of the system.
a7333da7 111 * Set in main() with the current page size.
12744796
DG
112 */
113extern long page_size;
114
5e97de00
JG
115/* Application health monitoring */
116extern struct health_app *health_sessiond;
117
a7333da7 118extern struct sessiond_config config;
26296c48 119
a7333da7 120extern int lttng_sessiond_ready;
f43f95a9 121
a7333da7
JG
122extern int ust_consumerd64_fd, ust_consumerd32_fd;
123
124/* Parent PID for --sig-parent option */
125extern pid_t ppid;
126/* Internal parent PID use with daemonize. */
127extern pid_t child_ppid;
e9404c27 128
a7333da7 129int sessiond_init_thread_quit_pipe(void);
d0b96690 130int sessiond_check_thread_quit_pipe(int fd, uint32_t events);
a7333da7
JG
131int sessiond_wait_for_quit_pipe(unsigned int timeout_us);
132int sessiond_notify_quit_pipe(void);
133void sessiond_close_quit_pipe(void);
134
5e97de00 135int sessiond_set_thread_pollset(struct lttng_poll_event *events, size_t size);
ef367a93 136void sessiond_notify_ready(void);
9cc1ba3b 137void sessiond_signal_parents(void);
ef367a93 138
99d688f2
JG
139void sessiond_set_client_thread_state(bool running);
140void sessiond_wait_client_thread_stopped(void);
141
fac6795d 142#endif /* _LTT_SESSIOND_H */
This page took 0.060914 seconds and 4 git commands to generate.