rotation-api: introduce rotation schedule descriptors
[lttng-tools.git] / src / bin / lttng / commands / rotate.c
index 05e55bf3cc39d1eb8a138641061b33d69f886fc1..1e4677ffd18bb4503dd6b64f295536fe24e4c327 100644 (file)
@@ -209,25 +209,13 @@ end:
 static int rotate_tracing(char *session_name)
 {
        int ret;
-       struct lttng_rotation_immediate_attr *attr = NULL;
        struct lttng_rotation_handle *handle = NULL;
        enum lttng_rotation_status rotation_status;
        enum lttng_rotation_state rotation_state = LTTNG_ROTATION_STATE_ONGOING;
 
        DBG("Rotating the output files of session %s", session_name);
 
-       attr = lttng_rotation_immediate_attr_create();
-       if (!attr) {
-               goto error;
-       }
-
-       ret = lttng_rotation_immediate_attr_set_session_name(attr, session_name);
-       if (ret < 0) {
-               ERR("Session name exceeds the maximal allowed length");
-               goto error;
-       }
-
-       ret = lttng_rotate_session(attr, &handle);
+       ret = lttng_rotate_session(session_name, NULL, &handle);
        if (ret < 0) {
                switch (-ret) {
                case LTTNG_ERR_SESSION_NOT_STARTED:
@@ -314,7 +302,6 @@ error:
        ret = CMD_ERROR;
 end:
        lttng_rotation_handle_destroy(handle);
-       lttng_rotation_immediate_attr_destroy(attr);
        return ret;
 }
 
@@ -390,7 +377,7 @@ int cmd_rotate(int argc, const char **argv)
 
                /* Open rotations element */
                ret = mi_lttng_writer_open_element(writer,
-                               mi_lttng_element_rotations);
+                               mi_lttng_element_rotation_schedules);
                if (ret) {
                        goto end;
                }
@@ -404,12 +391,12 @@ int cmd_rotate(int argc, const char **argv)
 
        /* Mi closing */
        if (lttng_opt_mi) {
-               /* Close  rotations element */
+               /* Close rotations element */
                ret = mi_lttng_writer_close_element(writer);
                if (ret) {
                        goto end;
                }
-               /* Close  output element */
+               /* Close output element */
                ret = mi_lttng_writer_close_element(writer);
                if (ret) {
                        goto end;
This page took 0.023895 seconds and 4 git commands to generate.