+/*
+ * List the rotate settings (timer/size if any).
+ */
+static int list_rotate_settings(const char *session_name)
+{
+ int ret;
+ uint64_t size, timer;
+
+ ret = lttng_rotation_schedule_get_timer_period(session_name, &timer);
+ if (ret) {
+ goto end;
+ }
+
+ ret = lttng_rotation_schedule_get_size(session_name, &size);
+ if (ret) {
+ goto end;
+ }
+
+ if (!timer && !size) {
+ ret = 0;
+ goto end;
+ }
+
+ _MSG("Automatic rotation schedule settings:\n");
+
+ if (timer) {
+ _MSG(" timer period: %" PRIu64" µs\n", timer);
+ if (lttng_opt_mi) {
+ ret = mi_lttng_writer_write_element_unsigned_int(writer,
+ config_element_rotation_timer_interval, timer);
+ if (ret) {
+ goto end;
+ }
+ }
+ }
+ if (size) {
+ _MSG(" size threshold: %" PRIu64" bytes\n", size);
+ if (lttng_opt_mi) {
+ ret = mi_lttng_writer_write_element_unsigned_int(writer,
+ config_element_rotation_size, size);
+ if (ret) {
+ goto end;
+ }
+ }
+ }
+ _MSG("\n");
+
+end:
+ return ret;
+}
+