+ status = lttng_destruction_handle_get_rotation_state(handle,
+ &rotation_state);
+ if (status != LTTNG_DESTRUCTION_HANDLE_STATUS_OK) {
+ ERR("Failed to get rotation state from destruction handle");
+ goto skip_wait_rotation;
+ }
+ switch (rotation_state) {
+ case LTTNG_ROTATION_STATE_NO_ROTATION:
+ break;
+ case LTTNG_ROTATION_STATE_COMPLETED:
+ {
+ const struct lttng_trace_archive_location *location;
+
+ status = lttng_destruction_handle_get_archive_location(handle,
+ &location);
+ if (status == LTTNG_DESTRUCTION_HANDLE_STATUS_OK) {
+ if (printed_wait_msg) {
+ MSG("");
+ printed_wait_msg = false;
+ }
+ ret = print_trace_archive_location(location,
+ session->name);
+ if (ret) {
+ ERR("Failed to print the location of trace archive");
+ goto skip_wait_rotation;
+ }
+ break;
+ }
+ /* fall-through. */
+ }
+ default:
+ ERR("Failed to get the location of the rotation performed during the session's destruction");
+ goto skip_wait_rotation;
+ }
+skip_wait_rotation:
+ MSG("%sSession \"%s\" destroyed", printed_wait_msg ? "\n" : "",
+ session->name);
+ printed_wait_msg = false;