Dedicated error message when relay does not support rotations
[lttng-tools.git] / include / lttng / rotation.h
index 9b797ac11c2783256c420f1cd70b22da08c835bd..0b4b2ad2f5eb8f92c01e60f9a484e8d23c3b19fd 100644 (file)
@@ -29,15 +29,19 @@ extern "C" {
  * Return codes for lttng_rotation_handle_get_state()
  */
 enum lttng_rotation_state {
+       /*
+        * Session has not been rotated.
+        */
+       LTTNG_ROTATION_STATE_NO_ROTATION = 0,
        /*
         * Rotation is ongoing, but has not been completed yet.
         */
-       LTTNG_ROTATION_STATE_ONGOING = 0,
+       LTTNG_ROTATION_STATE_ONGOING = 1,
        /*
         * Rotation has been completed and the resulting chunk
         * can now safely be read.
         */
-       LTTNG_ROTATION_STATE_COMPLETED = 1,
+       LTTNG_ROTATION_STATE_COMPLETED = 2,
        /*
         * The rotation has expired.
         *
@@ -48,11 +52,11 @@ enum lttng_rotation_state {
         * Note that this state does not guarantee the the rotation was
         * completed successfully.
         */
-       LTTNG_ROTATION_STATE_EXPIRED = 2,
+       LTTNG_ROTATION_STATE_EXPIRED = 3,
        /*
         * The rotation could not be completed due to an error.
         */
-       LTTNG_ROTATION_STATE_ERROR = 3,
+       LTTNG_ROTATION_STATE_ERROR = 4,
 };
 
 enum lttng_rotation_status {
@@ -134,6 +138,12 @@ extern enum lttng_rotation_status lttng_rotation_schedule_attr_set_session_name(
 extern enum lttng_rotation_status lttng_rotation_schedule_attr_set_timer_period(
                struct lttng_rotation_schedule_attr *attr, uint64_t timer);
 
+/*
+ * Set the size to rotate the session (bytes, -1ULL to disable).
+ */
+void lttng_rotation_schedule_attr_set_size(
+               struct lttng_rotation_schedule_attr *attr, uint64_t size);
+
 /*
  * lttng rotate session handle functions.
  */
@@ -188,6 +198,26 @@ extern int lttng_rotate_session(struct lttng_rotation_immediate_attr *attr,
 extern int lttng_rotation_set_schedule(
                struct lttng_rotation_schedule_attr *attr);
 
+/*
+ * Ask the sessiond for the value of the rotate timer (in micro-seconds) of the
+ * session.
+ *
+ * On success, return 0 and set the value or rotate_timer, on error return a
+ * negative value.
+ */
+extern int lttng_rotation_schedule_get_timer_period(const char *session_name,
+               uint64_t *rotate_timer);
+
+/*
+ * Ask the sessiond for the value of the rotate size (in micro-seconds) of the
+ * session.
+ *
+ * On success, return 0 and set the value or rotate_size, on error return
+ * a negative value.
+ */
+extern int lttng_rotation_schedule_get_size(const char *session_name,
+               uint64_t *rotate_size);
+
 #ifdef __cplusplus
 }
 #endif
This page took 0.023665 seconds and 4 git commands to generate.