-int check_session_rotation_pending_local_on_consumer(
- const struct ltt_session *session,
- struct consumer_socket *socket, bool *rotation_completed)
-{
- int ret;
-
- pthread_mutex_lock(socket->lock);
- DBG("[rotation-thread] Checking for locally pending rotation on the %s consumer for session %s",
- lttng_consumer_type_str(socket->type),
- session->name);
- ret = consumer_check_rotation_pending_local(socket,
- session->id,
- session->current_archive_id - 1);
- pthread_mutex_unlock(socket->lock);
-
- if (ret == 0) {
- /* Rotation was completed on this consumer. */
- DBG("[rotation-thread] Local rotation of trace archive %" PRIu64 " of session \"%s\" was completed on the %s consumer",
- session->current_archive_id - 1,
- session->name,
- lttng_consumer_type_str(socket->type));
- *rotation_completed = true;
- } else if (ret == 1) {
- /* Rotation pending on this consumer. */
- DBG("[rotation-thread] Local rotation of trace archive %" PRIu64 " of session \"%s\" is pending on the %s consumer",
- session->current_archive_id - 1,
- session->name,
- lttng_consumer_type_str(socket->type));
- *rotation_completed = false;
- ret = 0;
- } else {
- /* Not a fatal error. */
- ERR("[rotation-thread] Encountered an error when checking if local rotation of trace archive %" PRIu64 " of session \"%s\" is pending on the %s consumer",
- session->current_archive_id - 1,
- session->name,
- lttng_consumer_type_str(socket->type));
- *rotation_completed = false;
- }
- return ret;
-}
-
-static
-int check_session_rotation_pending_local(struct ltt_session *session)