trigger: lttng_trigger_get_underlying_domain_type_restriction
[lttng-tools.git] / include / lttng / rotate-internal.h
index e359cd741050d7a860edacdf08a39d95c3df87a5..91289b4cf9fcd62ec173afd2a80951b269b7387e 100644 (file)
@@ -1,18 +1,8 @@
 /*
- * Copyright (C) 2017 Julien Desfossez <jdesfossez@efficios.com>
+ * Copyright (C) 2017 Julien Desfossez <jdesfossez@efficios.com>
  *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License, version 2.1 only,
- * as published by the Free Software Foundation.
+ * SPDX-License-Identifier: LGPL-2.1-only
  *
- * This library 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 Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef LTTNG_ROTATE_INTERNAL_ABI_H
 #include <lttng/rotation.h>
 #include <common/macros.h>
 
-/*
- * Object used as input parameter to the rotate session API for immediate
- * rotations.
- * This is opaque to the public library.
- */
-struct lttng_rotation_immediate_attr {
-       /* Session name to rotate. */
-       char session_name[LTTNG_NAME_MAX];
-       /* For the rotate pending request. */
-       uint64_t rotate_id;
-};
-
-/*
- * Object used as input parameter to the lttng_rotate_schedule API for
- * automatic rotations.
- * This is opaque to the public library.
- */
-struct lttng_rotation_schedule_attr {
-       /* Session name to rotate. */
-       char session_name[LTTNG_NAME_MAX];
-       /* > 0 if a timer is set. */
-       uint64_t timer_us;
-       /* > 0 if the session should rotate when it has written that many bytes. */
-       uint64_t size;
-} LTTNG_PACKED;
-
 /*
  * Object returned by the rotate session API.
  * This is opaque to the public library.
@@ -72,6 +36,35 @@ struct lttng_rotation_handle {
        struct lttng_trace_archive_location *archive_location;
 };
 
+struct lttng_rotation_schedule {
+       enum lttng_rotation_schedule_type type;
+};
+
+struct lttng_rotation_schedule_size_threshold {
+       struct lttng_rotation_schedule parent;
+       struct {
+               bool set;
+               uint64_t bytes;
+       } size;
+};
+
+struct lttng_rotation_schedule_periodic {
+       struct lttng_rotation_schedule parent;
+       struct {
+               bool set;
+               uint64_t us;
+       } period;
+};
+
+struct lttng_rotation_schedules {
+       /*
+        * Only one rotation schedule per type is supported for now.
+        * Schedules are owned by this object.
+        */
+       unsigned int count;
+       struct lttng_rotation_schedule *schedules[2];
+};
+
 /*
  * Internal objects between lttng-ctl and the session daemon, the values
  * are then copied to the user's lttng_rotation_handle object.
@@ -86,7 +79,9 @@ struct lttng_rotate_session_return {
 struct lttng_rotation_get_info_return {
        /* Represents values defined in enum lttng_rotation_state. */
        int32_t status;
-       /* Represents values defined in enum lttng_rotation_state. */
+       /*
+        * Represents values defined in enum lttng_trace_archive_location_type.
+        */
        int8_t location_type;
        union {
                struct {
@@ -108,19 +103,16 @@ struct lttng_rotation_get_info_return {
        } location;
 } LTTNG_PACKED;
 
-/* For the LTTNG_SESSION_GET_CURRENT_OUTPUT command. */
-struct lttng_session_get_current_output_return {
-       char path[LTTNG_PATH_MAX];
-} LTTNG_PACKED;
-
-/* For the LTTNG_ROTATION_SCHEDULE_GET_TIMER_PERIOD command. */
-struct lttng_rotation_schedule_get_timer_period {
-       uint64_t rotate_timer;
-} LTTNG_PACKED;
-
-/* For the LTTNG_ROTATION_SCHEDULE_GET_SIZE command. */
-struct lttng_rotation_schedule_get_size {
-       uint64_t rotate_size;
+/* For the LTTNG_SESSION_LIST_SCHEDULES command. */
+struct lttng_session_list_schedules_return {
+       struct {
+               uint8_t set;
+               uint64_t value;
+       } periodic;
+       struct {
+               uint8_t set;
+               uint64_t value;
+       } size;
 } LTTNG_PACKED;
 
 #endif /* LTTNG_ROTATE_INTERNAL_ABI_H */
This page took 0.023895 seconds and 4 git commands to generate.