2 * Copyright (C) 2017 - Julien Desfossez <jdesfossez@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 ROTATION_THREAD_H
19 #define ROTATION_THREAD_H
21 #include <urcu/list.h>
23 #include <urcu/rculfhash.h>
24 #include <lttng/domain.h>
25 #include <common/pipe.h>
26 #include <common/compat/poll.h>
27 #include <common/hashtable/hashtable.h>
29 #include <semaphore.h>
33 * The timer thread enqueues struct sessiond_rotation_timer objects in the list
34 * and wake up the rotation thread. When the rotation thread wakes up, it
37 struct rotation_thread_timer_queue
{
38 struct lttng_pipe
*event_pipe
;
39 struct cds_list_head list
;
43 struct rotation_thread_handle
{
45 * Read side of pipes used to communicate with the rotation thread.
47 /* Notification from the consumers */
54 struct rotation_thread_timer_queue
*rotation_timer_queue
;
56 /* Access to the notification thread cmd_queue */
57 struct notification_thread_handle
*notification_thread_handle
;
59 sem_t
*notification_thread_ready
;
62 struct rotation_thread_handle
*rotation_thread_handle_create(
63 struct lttng_pipe
*ust32_channel_rotate_pipe
,
64 struct lttng_pipe
*ust64_channel_rotate_pipe
,
65 struct lttng_pipe
*kernel_channel_rotate_pipe
,
67 struct rotation_thread_timer_queue
*rotation_timer_queue
,
68 struct notification_thread_handle
*notification_thread_handle
,
69 sem_t
*notification_thread_ready
);
71 void rotation_thread_handle_destroy(
72 struct rotation_thread_handle
*handle
);
74 void *thread_rotation(void *data
);
76 #endif /* ROTATION_THREAD_H */