Coverity warning: sessiond: uncaught exception in main
[lttng-tools.git] / include / lttng / rotate-internal.hpp
CommitLineData
5c408ad8 1/*
ab5be9fa 2 * Copyright (C) 2017 Julien Desfossez <jdesfossez@efficios.com>
5c408ad8 3 *
ab5be9fa 4 * SPDX-License-Identifier: LGPL-2.1-only
5c408ad8 5 *
5c408ad8
JD
6 */
7
8#ifndef LTTNG_ROTATE_INTERNAL_ABI_H
9#define LTTNG_ROTATE_INTERNAL_ABI_H
10
28f23191 11#include <common/macros.hpp>
5c408ad8
JD
12
13#include <lttng/constant.h>
14#include <lttng/rotation.h>
28f23191
JG
15
16#include <limits.h>
17#include <stdbool.h>
18#include <stdint.h>
5c408ad8 19
d68c9a04
JD
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 */
dd73d57b 37 struct lttng_trace_archive_location *archive_location;
d68c9a04
JD
38};
39
66ea93b1
JG
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
5c408ad8
JD
69/*
70 * Internal objects between lttng-ctl and the session daemon, the values
d68c9a04 71 * are then copied to the user's lttng_rotation_handle object.
5c408ad8 72 */
d68c9a04 73
37a5ef39 74/* For the LTTCOMM_SESSIOND_COMMAND_ROTATE_SESSION command. */
5c408ad8 75struct lttng_rotate_session_return {
d68c9a04
JD
76 uint64_t rotation_id;
77} LTTNG_PACKED;
78
37a5ef39 79/* For the LTTCOMM_SESSIOND_COMMAND_ROTATION_GET_INFO command. */
d68c9a04
JD
80struct lttng_rotation_get_info_return {
81 /* Represents values defined in enum lttng_rotation_state. */
5c408ad8 82 int32_t status;
3e3665b8
JG
83 /*
84 * Represents values defined in enum lttng_trace_archive_location_type.
85 */
05f8afa9 86 int8_t location_type;
dd73d57b
JG
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 */
05f8afa9 97 int8_t protocol;
dd73d57b
JG
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;
d68c9a04
JD
105} LTTNG_PACKED;
106
66ea93b1
JG
107/* For the LTTNG_SESSION_LIST_SCHEDULES command. */
108struct lttng_session_list_schedules_return {
109 struct {
110 uint8_t set;
111 uint64_t value;
e5d671a8 112 } LTTNG_PACKED periodic;
66ea93b1
JG
113 struct {
114 uint8_t set;
115 uint64_t value;
e5d671a8 116 } LTTNG_PACKED size;
329f3443
JD
117} LTTNG_PACKED;
118
5c408ad8 119#endif /* LTTNG_ROTATE_INTERNAL_ABI_H */
This page took 0.06234 seconds and 4 git commands to generate.