return ret;
}
-int timer_session_rotation_pending_check_start(struct ltt_session *session,
+int timer_session_rotation_pending_check_start(const ltt_session::locked_ref& session,
unsigned int interval_us)
{
int ret;
- if (!session_get(session)) {
+ if (!session_get(&session.get())) {
ret = -1;
goto end;
}
+
DBG("Enabling session rotation pending check timer on session %" PRIu64, session->id);
/*
* We arm this timer in a one-shot mode so we don't have to disable it
* no need to go through the whole signal teardown scheme everytime.
*/
ret = timer_start(&session->rotation_pending_check_timer,
- session,
+ &session.get(),
interval_us,
LTTNG_SESSIOND_SIG_PENDING_ROTATION_CHECK,
/* one-shot */ true);
}
/*
- * Call with session and session_list locks held.
+ * Call with session_list lock held.
*/
-int timer_session_rotation_pending_check_stop(struct ltt_session *session)
+int timer_session_rotation_pending_check_stop(const ltt_session::locked_ref& session)
{
int ret;
- LTTNG_ASSERT(session);
LTTNG_ASSERT(session->rotation_pending_check_timer_enabled);
DBG("Disabling session rotation pending check timer on session %" PRIu64, session->id);
/*
* The timer's reference to the session can be released safely.
*/
- session_put(session);
+ session_put(&session.get());
}
+
return ret;
}
/*
- * Call with session and session_list locks held.
+ * Call with session_list lock held.
*/
-int timer_session_rotation_schedule_timer_start(struct ltt_session *session,
+int timer_session_rotation_schedule_timer_start(const ltt_session::locked_ref& session,
unsigned int interval_us)
{
int ret;
- if (!session_get(session)) {
+ if (!session_get(&session.get())) {
ret = -1;
goto end;
}
interval_us,
USEC_UNIT);
ret = timer_start(&session->rotation_schedule_timer,
- session,
+ &session.get(),
interval_us,
LTTNG_SESSIOND_SIG_SCHEDULED_ROTATION,
/* one-shot */ false);
/*
* Call with session and session_list locks held.
*/
-int timer_session_rotation_schedule_timer_stop(struct ltt_session *session)
+int timer_session_rotation_schedule_timer_stop(const ltt_session::locked_ref& session)
{
int ret = 0;
- LTTNG_ASSERT(session);
-
if (!session->rotation_schedule_timer_enabled) {
goto end;
}
session->rotation_schedule_timer_enabled = false;
/* The timer's reference to the session can be released safely. */
- session_put(session);
+ session_put(&session.get());
ret = 0;
end:
return ret;
struct ltt_session *session =
(struct ltt_session *) info.si_value.sival_ptr;
- rotation_thread_enqueue_job(ctx->rotation_thread_job_queue,
- ROTATION_THREAD_JOB_TYPE_CHECK_PENDING_ROTATION,
- session);
+ rotation_thread_enqueue_job(
+ ctx->rotation_thread_job_queue,
+ lttng::sessiond::rotation_thread_job_type::CHECK_PENDING_ROTATION,
+ session);
} else if (signr == LTTNG_SESSIOND_SIG_SCHEDULED_ROTATION) {
- rotation_thread_enqueue_job(ctx->rotation_thread_job_queue,
- ROTATION_THREAD_JOB_TYPE_SCHEDULED_ROTATION,
- (struct ltt_session *) info.si_value.sival_ptr);
+ rotation_thread_enqueue_job(
+ ctx->rotation_thread_job_queue,
+ lttng::sessiond::rotation_thread_job_type::SCHEDULED_ROTATION,
+ (struct ltt_session *) info.si_value.sival_ptr);
/*
* The scheduled periodic rotation timer is not in
* "one-shot" mode. The reference to the session is not