X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Frotation-thread.c;h=05627f9345d6151e28db2a3534a99c9f1b5d08b9;hp=7bd6c681982fe1c18b6f0b039176650f17d6af2a;hb=6ae1bf4602f7bfd3a1a206aaf98295191cef5082;hpb=49176d734e1f76006e7b1678ba7f593d8f34717d diff --git a/src/bin/lttng-sessiond/rotation-thread.c b/src/bin/lttng-sessiond/rotation-thread.c index 7bd6c6819..05627f934 100644 --- a/src/bin/lttng-sessiond/rotation-thread.c +++ b/src/bin/lttng-sessiond/rotation-thread.c @@ -489,14 +489,14 @@ int check_session_rotation_pending(struct ltt_session *session, */ ret = timer_session_rotation_pending_check_stop(session); if (ret) { - goto end; + goto check_ongoing_rotation; } check_session_rotation_pending_on_consumers(session, &rotation_completed); if (!rotation_completed || session->rotation_state == LTTNG_ROTATION_STATE_ERROR) { - goto end; + goto check_ongoing_rotation; } /* @@ -562,7 +562,7 @@ int check_session_rotation_pending(struct ltt_session *session, } ret = 0; -end: +check_ongoing_rotation: if (session->rotation_state == LTTNG_ROTATION_STATE_ONGOING) { uint64_t chunk_being_archived_id; @@ -582,6 +582,7 @@ end: } } +end: return ret; } @@ -832,8 +833,7 @@ void *thread_rotation(void *data) int ret; struct rotation_thread_handle *handle = data; struct rotation_thread thread; - const int queue_pipe_fd = lttng_pipe_get_readfd( - handle->rotation_timer_queue->event_pipe); + int queue_pipe_fd; DBG("[rotation-thread] Started rotation thread"); @@ -842,6 +842,9 @@ void *thread_rotation(void *data) goto end; } + queue_pipe_fd = lttng_pipe_get_readfd( + handle->rotation_timer_queue->event_pipe); + rcu_register_thread(); rcu_thread_online();