Commit | Line | Data |
---|---|---|
c19092cd | 1 | /* |
ab5be9fa | 2 | * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
c19092cd | 3 | * |
ab5be9fa | 4 | * SPDX-License-Identifier: LGPL-2.1-only |
c19092cd | 5 | * |
c19092cd JG |
6 | */ |
7 | ||
8 | #ifndef LTTNG_CONDITION_SESSION_ROTATION_INTERNAL_H | |
9 | #define LTTNG_CONDITION_SESSION_ROTATION_INTERNAL_H | |
10 | ||
11 | #include <lttng/condition/session-rotation.h> | |
12 | #include <lttng/condition/condition-internal.h> | |
13 | #include <lttng/condition/evaluation-internal.h> | |
14 | #include "common/buffer-view.h" | |
15 | #include <lttng/location.h> | |
aa52c986 | 16 | #include <common/macros.h> |
c19092cd | 17 | |
7966af57 SM |
18 | #ifdef __cplusplus |
19 | extern "C" { | |
20 | #endif | |
21 | ||
c19092cd JG |
22 | struct lttng_condition_session_rotation { |
23 | struct lttng_condition parent; | |
24 | char *session_name; | |
25 | }; | |
26 | ||
27 | struct lttng_condition_session_rotation_comm { | |
28 | /* Length includes the trailing \0. */ | |
29 | uint32_t session_name_len; | |
30 | char session_name[]; | |
31 | } LTTNG_PACKED; | |
32 | ||
33 | struct lttng_evaluation_session_rotation { | |
34 | struct lttng_evaluation parent; | |
35 | uint64_t id; | |
36 | struct lttng_trace_archive_location *location; | |
37 | }; | |
38 | ||
39 | struct lttng_evaluation_session_rotation_comm { | |
40 | uint64_t id; | |
41 | uint8_t has_location; | |
42 | } LTTNG_PACKED; | |
43 | ||
c0a66c84 JG |
44 | ssize_t lttng_condition_session_rotation_ongoing_create_from_payload( |
45 | struct lttng_payload_view *view, | |
c19092cd JG |
46 | struct lttng_condition **condition); |
47 | ||
c0a66c84 JG |
48 | ssize_t lttng_condition_session_rotation_completed_create_from_payload( |
49 | struct lttng_payload_view *view, | |
c19092cd JG |
50 | struct lttng_condition **condition); |
51 | ||
c19092cd JG |
52 | struct lttng_evaluation *lttng_evaluation_session_rotation_ongoing_create( |
53 | uint64_t id); | |
54 | ||
55 | /* Ownership of location is transferred to the evaluation. */ | |
c19092cd JG |
56 | struct lttng_evaluation *lttng_evaluation_session_rotation_completed_create( |
57 | uint64_t id, | |
58 | struct lttng_trace_archive_location *location); | |
59 | ||
c0a66c84 JG |
60 | ssize_t lttng_evaluation_session_rotation_ongoing_create_from_payload( |
61 | struct lttng_payload_view *view, | |
c19092cd JG |
62 | struct lttng_evaluation **evaluation); |
63 | ||
c0a66c84 JG |
64 | ssize_t lttng_evaluation_session_rotation_completed_create_from_payload( |
65 | struct lttng_payload_view *view, | |
c19092cd JG |
66 | struct lttng_evaluation **evaluation); |
67 | ||
7966af57 SM |
68 | #ifdef __cplusplus |
69 | } | |
70 | #endif | |
71 | ||
c19092cd | 72 | #endif /* LTTNG_CONDITION_SESSION_ROTATION_INTERNAL_H */ |