2 * Copyright (C) 2017 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License, version 2 only, as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 51
15 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 #ifndef NOTIFICATION_THREAD_H
19 #define NOTIFICATION_THREAD_H
21 #include <urcu/list.h>
23 #include <urcu/rculfhash.h>
24 #include <lttng/trigger/trigger.h>
25 #include <common/pipe.h>
26 #include <common/compat/poll.h>
27 #include <common/hashtable/hashtable.h>
30 struct notification_thread_handle
{
32 * Queue of struct notification command.
33 * event_fd must be WRITE(2) to signal that a new command
38 struct cds_list_head list
;
42 * Read side of pipes used to receive channel status info collected
43 * by the various consumer daemons.
49 } channel_monitoring_pipes
;
52 struct notification_thread_state
{
53 int notification_channel_socket
;
54 struct lttng_poll_event events
;
55 struct cds_lfht
*client_socket_ht
;
56 struct cds_lfht
*channel_triggers_ht
;
57 struct cds_lfht
*channel_state_ht
;
58 struct cds_lfht
*notification_trigger_clients_ht
;
59 struct cds_lfht
*channels_ht
;
60 struct cds_lfht
*triggers_ht
;
63 /* notification_thread_data takes ownership of the channel monitor pipes. */
64 struct notification_thread_handle
*notification_thread_handle_create(
65 struct lttng_pipe
*ust32_channel_monitor_pipe
,
66 struct lttng_pipe
*ust64_channel_monitor_pipe
,
67 struct lttng_pipe
*kernel_channel_monitor_pipe
);
68 void notification_thread_handle_destroy(
69 struct notification_thread_handle
*handle
);
71 void *thread_notification(void *data
);
73 #endif /* NOTIFICATION_THREAD_H */