X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Ftimer.cpp;h=838983e3baa2d26a5b8c554a0a05e9d4ffe4449f;hb=69e98ad60c01ddfbfa6eb843960f77804173dd0f;hp=b99428041fabfae859620d6d338e1acdcf95d236;hpb=cd9adb8b829564212158943a0d279bb35322ab30;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/timer.cpp b/src/bin/lttng-sessiond/timer.cpp index b99428041..838983e3b 100644 --- a/src/bin/lttng-sessiond/timer.cpp +++ b/src/bin/lttng-sessiond/timer.cpp @@ -15,17 +15,17 @@ #include #include -#define LTTNG_SESSIOND_SIG_QS SIGRTMIN + 10 -#define LTTNG_SESSIOND_SIG_EXIT SIGRTMIN + 11 -#define LTTNG_SESSIOND_SIG_PENDING_ROTATION_CHECK SIGRTMIN + 12 -#define LTTNG_SESSIOND_SIG_SCHEDULED_ROTATION SIGRTMIN + 13 - -#define UINT_TO_PTR(value) \ - ({ \ - LTTNG_ASSERT(value <= UINTPTR_MAX); \ - (void *) (uintptr_t) value; \ +#define LTTNG_SESSIOND_SIG_QS (SIGRTMIN + 10) +#define LTTNG_SESSIOND_SIG_EXIT (SIGRTMIN + 11) +#define LTTNG_SESSIOND_SIG_PENDING_ROTATION_CHECK (SIGRTMIN + 12) +#define LTTNG_SESSIOND_SIG_SCHEDULED_ROTATION (SIGRTMIN + 13) + +#define UINT_TO_PTR(value) \ + ({ \ + LTTNG_ASSERT((value) <= UINTPTR_MAX); \ + (void *) (uintptr_t) (value); \ }) -#define PTR_TO_UINT(ptr) ((uintptr_t) ptr) +#define PTR_TO_UINT(ptr) ((uintptr_t) (ptr)) namespace { /* @@ -233,25 +233,25 @@ end: /* * Call with session and session_list locks held. */ -int timer_session_rotation_pending_check_stop(struct ltt_session *session) +int timer_session_rotation_pending_check_stop(ltt_session& session) { int ret; - LTTNG_ASSERT(session); - LTTNG_ASSERT(session->rotation_pending_check_timer_enabled); + LTTNG_ASSERT(session.rotation_pending_check_timer_enabled); - DBG("Disabling session rotation pending check timer on session %" PRIu64, session->id); - ret = timer_stop(&session->rotation_pending_check_timer, + DBG("Disabling session rotation pending check timer on session %" PRIu64, session.id); + ret = timer_stop(&session.rotation_pending_check_timer, LTTNG_SESSIOND_SIG_PENDING_ROTATION_CHECK); if (ret == -1) { ERR("Failed to stop rotate_pending_check timer"); } else { - session->rotation_pending_check_timer_enabled = false; + session.rotation_pending_check_timer_enabled = false; /* * The timer's reference to the session can be released safely. */ - session_put(session); + session_put(&session); } + return ret; } @@ -379,13 +379,15 @@ static void *thread_timer(void *data) 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