2 * Copyright (C) 2017 - Julien Desfossez <jdesfossez@efficios.com>
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.
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
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 #ifndef SESSIOND_TIMER_H
19 #define SESSIOND_TIMER_H
25 #define LTTNG_SESSIOND_SIG_TEARDOWN SIGRTMIN + 10
26 #define LTTNG_SESSIOND_SIG_EXIT SIGRTMIN + 11
27 #define LTTNG_SESSIOND_SIG_ROTATE_PENDING SIGRTMIN + 12
28 #define LTTNG_SESSIOND_SIG_ROTATE_TIMER SIGRTMIN + 13
30 #define CLOCKID CLOCK_MONOTONIC
33 * Handle timer teardown race wrt memory free of private data by sessiond
34 * signals are handled by a single thread, which permits a synchronization
35 * point between handling of each signal. Internal lock ensures mutual
38 struct timer_signal_data
{
39 /* Thread managing signals. */
45 struct timer_thread_parameters
{
46 struct rotation_thread_timer_queue
*rotation_timer_queue
;
49 struct sessiond_rotation_timer
{
52 /* List member in struct rotation_thread_timer_queue. */
53 struct cds_list_head head
;
56 void *sessiond_timer_thread(void *data
);
57 int sessiond_timer_signal_init(void);
59 int sessiond_timer_rotate_pending_start(struct ltt_session
*session
,
60 unsigned int interval_us
);
61 int sessiond_timer_rotate_pending_stop(struct ltt_session
*session
);
63 int sessiond_rotate_timer_start(struct ltt_session
*session
,
64 unsigned int interval_us
);
65 int sessiond_rotate_timer_stop(struct ltt_session
*session
);
67 #endif /* SESSIOND_TIMER_H */