X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fsessiond-timer.h;h=83be4873ce3381942b0e69ea878331dbbe088109;hp=e1b8a7eaded2d0a23ac34dad435611d319d90f19;hb=92816cc33a1add3c8276839bd6335e17423577dd;hpb=d086f507d02078aed618ab291a0bc4a634958fa3 diff --git a/src/bin/lttng-sessiond/sessiond-timer.h b/src/bin/lttng-sessiond/sessiond-timer.h index e1b8a7ead..83be4873c 100644 --- a/src/bin/lttng-sessiond/sessiond-timer.h +++ b/src/bin/lttng-sessiond/sessiond-timer.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2017 - Julien Desfossez + * Copyright (C) 2018 - Jérémie Galarneau * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2 only, @@ -22,36 +23,25 @@ #include "session.h" -#define LTTNG_SESSIOND_SIG_TEARDOWN SIGRTMIN + 10 -#define LTTNG_SESSIOND_SIG_EXIT SIGRTMIN + 11 - -#define CLOCKID CLOCK_MONOTONIC - -/* - * Handle timer teardown race wrt memory free of private data by sessiond - * signals are handled by a single thread, which permits a synchronization - * point between handling of each signal. Internal lock ensures mutual - * exclusion. - */ -struct timer_signal_data { - /* Thread managing signals. */ - pthread_t tid; - int qs_done; - pthread_mutex_t lock; -}; - struct timer_thread_parameters { - struct rotation_thread_timer_queue *rotation_timer_queue; + struct rotation_thread_timer_queue *rotation_thread_job_queue; }; -struct sessiond_rotation_timer { - uint64_t session_id; - unsigned int signal; - /* List member in struct rotation_thread_timer_queue. */ - struct cds_list_head head; -}; +int timer_signal_init(void); +void *timer_thread_func(void *data); + +void timer_exit(void); + +/* Start a session's rotation pending check timer (one-shot mode). */ +int timer_session_rotation_pending_check_start(struct ltt_session *session, + unsigned int interval_us); +/* Stop a session's rotation pending check timer. */ +int timer_session_rotation_pending_check_stop(struct ltt_session *session); -void *sessiond_timer_thread(void *data); -int sessiond_timer_signal_init(void); +/* Start a session's rotation schedule timer. */ +int timer_session_rotation_schedule_timer_start(struct ltt_session *session, + unsigned int interval_us); +/* Stop a session's rotation schedule timer. */ +int timer_session_rotation_schedule_timer_stop(struct ltt_session *session); #endif /* SESSIOND_TIMER_H */