+int sessiond_rotate_timer_start(struct ltt_session *session,
+ unsigned int interval_us)
+{
+ int ret;
+
+ DBG("Enabling rotation timer on session \"%s\" (%ui µs)", session->name,
+ interval_us);
+ ret = session_timer_start(&session->rotate_timer, session, interval_us,
+ LTTNG_SESSIOND_SIG_ROTATE_TIMER, false);
+ if (ret < 0) {
+ goto end;
+ }
+ session->rotate_timer_enabled = true;
+end:
+ return ret;
+}
+
+/*
+ * Stop and delete the channel's live timer.
+ */
+int sessiond_rotate_timer_stop(struct ltt_session *session)
+{
+ int ret = 0;
+
+ assert(session);
+
+ if (!session->rotate_timer_enabled) {
+ goto end;
+ }
+
+ DBG("Disabling rotation timer on session %s", session->name);
+ ret = session_timer_stop(&session->rotate_timer,
+ LTTNG_SESSIOND_SIG_ROTATE_TIMER);
+ if (ret < 0) {
+ ERR("Failed to stop rotate timer of session \"%s\"",
+ session->name);
+ goto end;
+ }
+
+ session->rotate_timer_enabled = false;
+ ret = 0;
+end:
+ return ret;