X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fmi-lttng.h;h=db85c7ca317e8391349bf1af3019e00127b6e6d0;hb=e1d64b5c248be1da1734357816e029527d6a2cce;hp=37136a8dbed4417ee0088baa9ea3e7cedeb68b30;hpb=66ea93b10c703e1b3dda1e17109eed9138e4ece2;p=lttng-tools.git diff --git a/src/common/mi-lttng.h b/src/common/mi-lttng.h index 37136a8db..db85c7ca3 100644 --- a/src/common/mi-lttng.h +++ b/src/common/mi-lttng.h @@ -110,8 +110,8 @@ extern const char * const mi_lttng_element_save; /* Strings related to load command */ extern const char * const mi_lttng_element_load; -LTTNG_HIDDEN const char * const mi_lttng_element_load_overrides; -LTTNG_HIDDEN const char * const mi_lttng_element_load_override_url; +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; @@ -186,21 +186,40 @@ extern const char * const mi_lttng_element_snapshot_session_name; 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 const char * const mi_lttng_element_session_name; +LTTNG_HIDDEN extern const char * const mi_lttng_element_session_name; /* String related to rotate command */ -LTTNG_HIDDEN const char * const mi_lttng_element_rotation; -LTTNG_HIDDEN const char * const mi_lttng_element_rotate_status; -LTTNG_HIDDEN const char * const mi_lttng_element_rotation_schedule; -LTTNG_HIDDEN const char * const mi_lttng_element_rotation_schedules; -LTTNG_HIDDEN const char * const mi_lttng_element_rotation_schedule_periodic; -LTTNG_HIDDEN const char * const mi_lttng_element_rotation_schedule_periodic_time_us; -LTTNG_HIDDEN const char * const mi_lttng_element_rotation_schedule_size_threshold; -LTTNG_HIDDEN const char * const mi_lttng_element_rotation_schedule_size_threshold_bytes; -LTTNG_HIDDEN const char * const mi_lttng_element_rotation_schedule_result; -LTTNG_HIDDEN const char * const mi_lttng_element_rotation_schedule_results; +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; @@ -211,6 +230,9 @@ const char *mi_lttng_logleveltype_string(enum lttng_loglevel_type value); 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_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. @@ -839,8 +861,6 @@ int mi_lttng_rotation_schedule(struct mi_writer *writer, * * writer: An instance of a machine interface writer. * - * session_name: The session to which the command applies. - * * schedule: An lttng rotation schedule descriptor object. * * success: Whether the sub-command suceeded. @@ -852,4 +872,29 @@ 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 */