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