X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Frotate.cpp;h=56a61fe2a35924430ce5dfe6dec548cca458fa87;hb=dc65dda314fcd676fabfe73942c34cb93b7fea40;hp=cc857544390ea24674b8da75cf035fc59a0fd430;hpb=20c734f5b9940033f4ab96e47523c7d9e3d299bb;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/rotate.cpp b/src/bin/lttng-sessiond/rotate.cpp index cc8575443..56a61fe2a 100644 --- a/src/bin/lttng-sessiond/rotate.cpp +++ b/src/bin/lttng-sessiond/rotate.cpp @@ -49,6 +49,7 @@ int subscribe_session_consumed_size_rotation( int ret; enum lttng_condition_status condition_status; enum lttng_notification_channel_status nc_status; + const uint64_t eventfd_increment_value = 1; struct lttng_condition *rotate_condition = nullptr; struct lttng_action *notify_action = nullptr; const struct lttng_credentials session_creds = { @@ -108,6 +109,15 @@ int subscribe_session_consumed_size_rotation( goto end; } + ret = lttng_write(rotate_notification_channel_subscription_change_eventfd, + &eventfd_increment_value, + sizeof(eventfd_increment_value)); + if (ret != sizeof(eventfd_increment_value)) { + PERROR("Failed to wake up rotation thread as writing to the rotation thread notification channel subscription change eventfd failed"); + ret = -1; + goto end; + } + ret = notification_thread_command_register_trigger( notification_thread_handle, session->rotate_trigger, true); if (ret < 0 && ret != -LTTNG_ERR_TRIGGER_EXISTS) { @@ -132,6 +142,7 @@ int unsubscribe_session_consumed_size_rotation( { int ret = 0; enum lttng_notification_channel_status status; + const uint64_t eventfd_increment_value = 1; LTTNG_ASSERT(session->rotate_trigger); status = lttng_notification_channel_unsubscribe( @@ -143,6 +154,15 @@ int unsubscribe_session_consumed_size_rotation( goto end; } + ret = lttng_write(rotate_notification_channel_subscription_change_eventfd, + &eventfd_increment_value, + sizeof(eventfd_increment_value)); + if (ret != sizeof(eventfd_increment_value)) { + PERROR("Failed to wake up rotation thread as writing to the rotation thread notification channel subscription change eventfd failed"); + ret = -1; + goto end; + } + ret = notification_thread_command_unregister_trigger(notification_thread_handle, session->rotate_trigger); if (ret != LTTNG_OK) {