rotate timer working
[deliverable/lttng-tools.git] / include / lttng / rotate-internal.h
CommitLineData
6e0be6cc
JD
1/*
2 * Copyright (C) 2017 - Julien Desfossez <jdesfossez@efficios.com>
3 *
4 * This library is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU Lesser General Public License, version 2.1 only,
6 * as published by the Free Software Foundation.
7 *
8 * This library is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11 * for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this library; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17
18#ifndef LTTNG_ROTATE_INTERNAL_ABI_H
19#define LTTNG_ROTATE_INTERNAL_ABI_H
20
21#include <limits.h>
22#include <stdint.h>
23
24#include <lttng/constant.h>
25#include <lttng/rotate.h>
26#include <common/macros.h>
27
28/*
29 * Object used as input parameter to the rotate session API.
30 * This is opaque to the public library.
31 */
32struct lttng_rotate_session_attr {
8cf2762e 33 /* Session name to rotate. */
6e0be6cc 34 char session_name[LTTNG_NAME_MAX];
8cf2762e
JD
35 /* For the rotate pending request. */
36 uint64_t rotate_id;
37 /* > 0 if a timer is set. */
38 uint64_t timer_us;
6e0be6cc 39 /*
8cf2762e
JD
40 * > 0 if the session should rotate when it has written that many
41 * bytes.
6e0be6cc 42 */
8cf2762e 43 uint64_t size;
6e0be6cc
JD
44} LTTNG_PACKED;
45
46/*
47 * Object returned by the rotate session API.
48 * This is opaque to the public library.
49 */
50struct lttng_rotate_session_handle {
51 char session_name[LTTNG_NAME_MAX];
52 /*
53 * ID of the rotate command.
54 * This matches the session->rotate_count, so the handle is valid until
55 * the next rotate command. After that, the rotate_pending command
56 * returns the expired state.
57 */
58 uint64_t rotate_id;
59 /*
60 * Where the rotated (readable) trace has been stored when the
61 * rotation is completed.
62 */
63 char output_path[PATH_MAX];
64 /*
65 * The state of the rotation.
66 */
67 enum lttng_rotate_status status;
68} LTTNG_PACKED;
69
70/*
71 * Internal objects between lttng-ctl and the session daemon, the values
72 * are then copied to the user's lttng_rotate_session_handle object.
73 */
74/* For the LTTNG_ROTATE_SESSION command. */
75struct lttng_rotate_session_return {
76 uint64_t rotate_id;
77 enum lttng_rotate_status status;
78} LTTNG_PACKED;
79
80/* For the LTTNG_ROTATE_PENDING command. */
81struct lttng_rotate_pending_return {
82 enum lttng_rotate_status status;
83 char output_path[PATH_MAX];
84} LTTNG_PACKED;
85
86#endif /* LTTNG_ROTATE_INTERNAL_ABI_H */
This page took 0.028509 seconds and 5 git commands to generate.