#include "notification-thread-commands.h"
#include "rotate.h"
#include "rotation-thread.h"
+#include "sessiond-timer.h"
#include "cmd.h"
}
}
+ if (session->rotate_relay_pending_timer_enabled) {
+ sessiond_timer_rotate_pending_stop(session);
+ }
+
/* Clean kernel session teardown */
kernel_destroy_session(ksess);
/* Dispatch thread */
CMM_STORE_SHARED(dispatch_thread_exit, 1);
futex_nto1_wake(&ust_cmd_queue.futex);
-
- /* timer thread */
- kill(getpid(), LTTNG_SESSIOND_SIG_EXIT);
}
/*
goto exit_set_signal_handler;
}
+ if (sessiond_timer_signal_init()) {
+ retval = -1;
+ goto exit_set_signal_handler;
+ }
+
setup_consumerd_path();
page_size = sysconf(_SC_PAGESIZE);
}
if (timer_thread_running) {
+ kill(getpid(), LTTNG_SESSIOND_SIG_EXIT);
ret = pthread_join(timer_thread, &status);
if (ret) {
errno = ret;
#include "health-sessiond.h"
#include "rotate.h"
#include "cmd.h"
+#include "sessiond-timer.h"
#include <urcu.h>
#include <urcu/list.h>
goto end;
}
channel_info->session->rotate_pending = false;
+ if (channel_info->session->rotate_pending_relay) {
+ ret = sessiond_timer_rotate_pending_start(
+ channel_info->session, 100000);
+ if (ret) {
+ ERR("Enabling rotate pending timer");
+ ret = -1;
+ goto end;
+ }
+ }
}
channel_rotation_info_destroy(channel_info);
return ret;
}
-int rotate_pending_timer_start(struct ltt_session *session, unsigned int
+int sessiond_timer_rotate_pending_start(struct ltt_session *session, unsigned int
interval_us)
{
int ret;
return ret;
}
+/*
+ * Stop and delete the channel's live timer.
+ */
+void sessiond_timer_rotate_pending_stop(struct ltt_session *session)
+{
+ int ret;
+
+ assert(session);
+
+ ret = session_timer_stop(&session->rotate_relay_pending_timer,
+ LTTNG_SESSIOND_SIG_ROTATE_PENDING);
+ if (ret == -1) {
+ ERR("Failed to stop live timer");
+ }
+
+ session->rotate_relay_pending_timer_enabled = 0;
+}
+
/*
* Block the RT signals for the entire process. It must be called from the
* sessiond main before creating the threads
}
continue;
} else if (signr == LTTNG_SESSIOND_SIG_TEARDOWN) {
+ fprintf(stderr, "TEARDOWN\n");
cmm_smp_mb();
CMM_STORE_SHARED(timer_signal.qs_done, 1);
cmm_smp_mb();
DBG("Signal timer metadata thread teardown");
} else if (signr == LTTNG_SESSIOND_SIG_EXIT) {
+ fprintf(stderr, "KILL\n");
goto end;
+ } else if (signr == LTTNG_SESSIOND_SIG_ROTATE_PENDING) {
+ fprintf(stderr, "ALLO TIMER\n");
} else {
ERR("Unexpected signal %d\n", info.si_signo);
}
void *sessiond_timer_thread(void *data);
int sessiond_timer_signal_init(void);
-int rotate_pending_timer_start(struct ltt_session *session, unsigned int
+int sessiond_timer_rotate_pending_start(struct ltt_session *session, unsigned int
interval_us);
+void sessiond_timer_rotate_pending_stop(struct ltt_session *session);
#endif /* SESSIOND_TIMER_H */