X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Frotate.c;h=1e4677ffd18bb4503dd6b64f295536fe24e4c327;hb=0e5e4beb5ab69ee57134ec704f850f37a48cb48b;hp=05e55bf3cc39d1eb8a138641061b33d69f886fc1;hpb=dd73d57bb95fae31161ca0781108d166082a06f5;p=lttng-tools.git diff --git a/src/bin/lttng/commands/rotate.c b/src/bin/lttng/commands/rotate.c index 05e55bf3c..1e4677ffd 100644 --- a/src/bin/lttng/commands/rotate.c +++ b/src/bin/lttng/commands/rotate.c @@ -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;