/*
- * Copyright (C) 2014 - Jonathan Rajotte <jonathan.r.julien@gmail.com>
- * - Olivier Cotte <olivier.cotte@polymtl.ca>
- * Copyright (C) 2016 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
+ * Copyright (C) 2014 Jonathan Rajotte <jonathan.r.julien@gmail.com>
+ * Copyright (C) 2014 Olivier Cotte <olivier.cotte@polymtl.ca>
+ * Copyright (C) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License, version 2 only, as
- * published by the Free Software Foundation.
+ * SPDX-License-Identifier: GPL-2.0-only
*
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _MI_LTTNG_H
extern const char * const mi_lttng_element_command;
extern const char * const mi_lttng_element_command_action;
extern const char * const mi_lttng_element_command_add_context;
-extern const char * const mi_lttng_element_command_calibrate;
extern const char * const mi_lttng_element_command_create;
extern const char * const mi_lttng_element_command_destroy;
extern const char * const mi_lttng_element_command_disable_channel;
extern const char * const mi_lttng_element_command_track;
extern const char * const mi_lttng_element_command_untrack;
extern const char * const mi_lttng_element_command_version;
+extern const char * const mi_lttng_element_command_rotate;
+extern const char * const mi_lttng_element_command_enable_rotation;
+extern const char * const mi_lttng_element_command_disable_rotation;
+extern const char * const mi_lttng_element_command_clear;
/* Strings related to version command */
extern const char * const mi_lttng_element_version;
/* Strings related to load command */
extern const char * const mi_lttng_element_load;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_load_overrides;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_load_override_url;
/* General element of mi_lttng */
extern const char * const mi_lttng_element_empty;
extern const char * const mi_lttng_loglevel_type_single;
extern const char * const mi_lttng_loglevel_type_unknown;
-/* Sting related to lttng_calibrate */
-extern const char * const mi_lttng_element_calibrate;
-extern const char * const mi_lttng_element_calibrate_function;
-
/* String related to a lttng_snapshot */
extern const char * const mi_lttng_element_snapshot_ctrl_url;
extern const char * const mi_lttng_element_snapshot_data_url;
extern const char * const mi_lttng_element_snapshots;
/* String related to track/untrack command */
-const char * const mi_lttng_element_track_untrack_all_wildcard;
+extern const char * const mi_lttng_element_track_untrack_all_wildcard;
+
+LTTNG_HIDDEN extern const char * const mi_lttng_element_session_name;
+
+/* String related to rotate command */
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotate_status;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_schedule;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_schedules;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_schedule_periodic;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_schedule_periodic_time_us;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_schedule_size_threshold;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_schedule_size_threshold_bytes;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_schedule_result;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_schedule_results;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_state;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_location;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_location_local;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_location_local_absolute_path;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_location_relay;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_location_relay_host;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_location_relay_control_port;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_location_relay_data_port;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_location_relay_protocol;
+LTTNG_HIDDEN extern const char * const mi_lttng_element_rotation_location_relay_relative_path;
+
+/* String related to enum lttng_rotation_state */
+LTTNG_HIDDEN extern const char * const mi_lttng_rotation_state_str_ongoing;
+LTTNG_HIDDEN extern const char * const mi_lttng_rotation_state_str_completed;
+LTTNG_HIDDEN extern const char * const mi_lttng_rotation_state_str_expired;
+LTTNG_HIDDEN extern const char * const mi_lttng_rotation_state_str_error;
+
+/* String related to enum lttng_trace_archive_location_relay_protocol_type */
+LTTNG_HIDDEN extern const char * const mi_lttng_rotation_location_relay_protocol_str_tcp;
+
+/* String related to add-context command */
+LTTNG_HIDDEN extern const char * const mi_lttng_element_context_symbol;
/* Utility string function */
const char *mi_lttng_loglevel_string(int value, enum lttng_domain_type domain);
const char *mi_lttng_eventfieldtype_string(enum lttng_event_field_type value);
const char *mi_lttng_domaintype_string(enum lttng_domain_type value);
const char *mi_lttng_buffertype_string(enum lttng_buffer_type value);
-const char *mi_lttng_calibratetype_string(enum lttng_calibrate_type val);
+const char *mi_lttng_rotation_state_string(enum lttng_rotation_state value);
+const char *mi_lttng_trace_archive_location_relay_protocol_type_string(
+ enum lttng_trace_archive_location_relay_protocol_type value);
/*
* Create an instance of a machine interface writer.
int mi_lttng_trackers_open(struct mi_writer *writer);
/*
- * Machine interface: open a pid_tracker element.
+ * Machine interface: open a id tracker element.
*
* writer An instance of a machine interface writer.
*
*
* Note: A targets element is also opened for each tracker definition
*/
-int mi_lttng_pid_tracker_open(struct mi_writer *writer);
+int mi_lttng_id_tracker_open(
+ struct mi_writer *writer, enum lttng_tracker_type tracker_type);
/*
* Machine interface: open a PIDs element.
int mi_lttng_targets_open(struct mi_writer *writer);
/*
- * Machine interface for track/untrack a pid_target
+ * Machine interface for track/untrack an id_target
*
* writer An instance of a machine interface writer.
*
* Returns zero if the element's value could be written.
* Negative values indicate an error.
*/
-int mi_lttng_pid_target(struct mi_writer *writer, pid_t pid, int is_open);
-
-/*
- * Machine interface for struct lttng_calibrate.
- *
- * writer An instance of a machine interface writer.
- *
- * calibrate A lttng_calibrate instance.
- *
- * Returns zero if the element's value could be written.
- * Negative values indicate an error.
- */
-int mi_lttng_calibrate(struct mi_writer *writer,
- struct lttng_calibrate *calibrate);
+int mi_lttng_id_target(struct mi_writer *writer,
+ enum lttng_tracker_type tracker_type,
+ const struct lttng_tracker_id *id,
+ int is_open);
/*
* Machine interface of a context.
const char *current_session_name, const char *url,
const char *cmdline_ctrl_url, const char *cmdline_data_url);
+/*
+ * Machine interface representation of a session rotation schedule.
+ *
+ * The machine interface serializes the provided schedule as one of the choices
+ * from 'rotation_schedule_type'.
+ *
+ * writer: An instance of a machine interface writer.
+ *
+ * schedule: An lttng rotation schedule descriptor object.
+ *
+ * Returns zero if the element's value could be written.
+ * Negative values indicate an error.
+ */
+int mi_lttng_rotation_schedule(struct mi_writer *writer,
+ const struct lttng_rotation_schedule *schedule);
+
+/*
+ * Machine interface of a session rotation schedule result.
+ * This is an element that is part of the output of the enable-rotation and
+ * disable-rotation commands.
+ *
+ * The machine interface provides the following information:
+ * - schedule: the session rotation schedule descriptor.
+ * - success: whether the sub-command succeeded.
+ *
+ * writer: An instance of a machine interface writer.
+ *
+ * schedule: An lttng rotation schedule descriptor object.
+ *
+ * success: Whether the sub-command suceeded.
+ *
+ * Returns zero if the element's value could be written.
+ * Negative values indicate an error.
+ */
+int mi_lttng_rotation_schedule_result(struct mi_writer *writer,
+ const struct lttng_rotation_schedule *schedule,
+ bool success);
+
+/*
+ * Machine interface of a session rotation result.
+ * This is an element that is part of the output of the rotate command.
+ *
+ * The machine interface provides the following information:
+ * - session_name: the session to be rotated.
+ * - state: the session rotation state.
+ * - location: the location of the completed chunk archive.
+ *
+ * writer: An instance of a machine interface writer.
+ *
+ * session_name: The session to which the rotate command applies.
+ *
+ * location: A location descriptor object.
+ *
+ * success: Whether the sub-command suceeded.
+ *
+ * Returns zero if the element's value could be written.
+ * Negative values indicate an error.
+ */
+int mi_lttng_rotate(struct mi_writer *writer,
+ const char *session_name,
+ enum lttng_rotation_state rotation_state,
+ const struct lttng_trace_archive_location *location);
+
#endif /* _MI_LTTNG_H */