-static int mi_output_rotate(const char *status, const char *path,
- const char *session_name)
-{
- int ret;
-
- if (!lttng_opt_mi) {
- ret = 0;
- goto end;
- }
-
- ret = mi_lttng_writer_open_element(writer,
- mi_lttng_element_rotation);
- if (ret) {
- goto end;
- }
-
- ret = mi_lttng_writer_write_element_string(writer,
- mi_lttng_element_session_name, session_name);
- if (ret) {
- goto end;
- }
-
- ret = mi_lttng_writer_write_element_string(writer,
- mi_lttng_element_rotate_status, status);
- if (ret) {
- goto end;
- }
- if (path) {
- ret = mi_lttng_writer_write_element_string(writer,
- config_element_path, path);
- if (ret) {
- goto end;
- }
- }
- /* Close rotation element */
- ret = mi_lttng_writer_close_element(writer);
- if (ret) {
- goto end;
- }
-
-end:
- return ret;
-}
-