Clean-up: modernize pretty_xml.cpp
[lttng-tools.git] / include / lttng / rotate-internal.hpp
... / ...
CommitLineData
1/*
2 * Copyright (C) 2017 Julien Desfossez <jdesfossez@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8#ifndef LTTNG_ROTATE_INTERNAL_ABI_H
9#define LTTNG_ROTATE_INTERNAL_ABI_H
10
11#include <common/macros.hpp>
12
13#include <lttng/constant.h>
14#include <lttng/rotation.h>
15
16#include <limits.h>
17#include <stdbool.h>
18#include <stdint.h>
19
20/*
21 * Object returned by the rotate session API.
22 * This is opaque to the public library.
23 */
24struct lttng_rotation_handle {
25 char session_name[LTTNG_NAME_MAX];
26 /*
27 * ID of the rotate command.
28 * This matches the session->rotate_count, so the handle is valid until
29 * the next rotate command. After that, the rotation_get_state command
30 * returns the "expired" state.
31 */
32 uint64_t rotation_id;
33 /*
34 * Where the rotated (readable) trace has been stored when the
35 * rotation is completed.
36 */
37 struct lttng_trace_archive_location *archive_location;
38};
39
40struct lttng_rotation_schedule {
41 enum lttng_rotation_schedule_type type;
42};
43
44struct lttng_rotation_schedule_size_threshold {
45 struct lttng_rotation_schedule parent;
46 struct {
47 bool set;
48 uint64_t bytes;
49 } size;
50};
51
52struct lttng_rotation_schedule_periodic {
53 struct lttng_rotation_schedule parent;
54 struct {
55 bool set;
56 uint64_t us;
57 } period;
58};
59
60struct lttng_rotation_schedules {
61 /*
62 * Only one rotation schedule per type is supported for now.
63 * Schedules are owned by this object.
64 */
65 unsigned int count;
66 struct lttng_rotation_schedule *schedules[2];
67};
68
69/*
70 * Internal objects between lttng-ctl and the session daemon, the values
71 * are then copied to the user's lttng_rotation_handle object.
72 */
73
74/* For the LTTCOMM_SESSIOND_COMMAND_ROTATE_SESSION command. */
75struct lttng_rotate_session_return {
76 uint64_t rotation_id;
77} LTTNG_PACKED;
78
79/* For the LTTCOMM_SESSIOND_COMMAND_ROTATION_GET_INFO command. */
80struct lttng_rotation_get_info_return {
81 /* Represents values defined in enum lttng_rotation_state. */
82 int32_t status;
83 /*
84 * Represents values defined in enum lttng_trace_archive_location_type.
85 */
86 int8_t location_type;
87 union {
88 struct {
89 char absolute_path[LTTNG_PATH_MAX];
90 } LTTNG_PACKED local;
91 struct {
92 char host[LTTNG_HOST_NAME_MAX];
93 /*
94 * Represents values defined in
95 * enum lttng_trace_archive_location_relay_protocol_type.
96 */
97 int8_t protocol;
98 struct {
99 uint16_t control;
100 uint16_t data;
101 } LTTNG_PACKED ports;
102 char relative_path[LTTNG_PATH_MAX];
103 } LTTNG_PACKED relay;
104 } location;
105} LTTNG_PACKED;
106
107/* For the LTTNG_SESSION_LIST_SCHEDULES command. */
108struct lttng_session_list_schedules_return {
109 struct {
110 uint8_t set;
111 uint64_t value;
112 } LTTNG_PACKED periodic;
113 struct {
114 uint8_t set;
115 uint64_t value;
116 } LTTNG_PACKED size;
117} LTTNG_PACKED;
118
119#endif /* LTTNG_ROTATE_INTERNAL_ABI_H */
This page took 0.023888 seconds and 4 git commands to generate.