- rotation_status = lttng_rotation_handle_get_status(handle);
- switch(rotation_status) {
- case LTTNG_ROTATION_STATUS_COMPLETED:
- lttng_rotation_handle_get_output_path(handle, &path);
- printf("Output files of session %s rotated to %s\n", session_name, path);
- ret = snprintf(cmd, PATH_MAX, "%s %s", ext_program, path);
+ switch (rotation_state) {
+ case LTTNG_ROTATION_STATE_COMPLETED:
+ {
+ const struct lttng_trace_archive_location *location;
+ const char *absolute_path;
+ enum lttng_trace_archive_location_status location_status;
+
+ rotation_status = lttng_rotation_handle_get_archive_location(
+ handle, &location);
+ if (rotation_status != LTTNG_ROTATION_STATUS_OK) {
+ fprintf(stderr, "Failed to retrieve the rotation's completed chunk archive location\n");
+ ret = -1;
+ goto end;
+ }
+
+ location_status = lttng_trace_archive_location_local_get_absolute_path(
+ location, &absolute_path);
+ if (location_status != LTTNG_TRACE_ARCHIVE_LOCATION_STATUS_OK) {
+ fprintf(stderr, "Failed to get absolute path of completed chunk archive");
+ ret = -1;
+ goto end;
+ }
+
+ printf("Output files of session %s rotated to %s\n",
+ session_name, absolute_path);
+ ret = snprintf(cmd, PATH_MAX, "%s %s", ext_program, absolute_path);