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 | ||
28f23191 JG |
11 | #include "common/buffer-view.hpp" |
12 | ||
13 | #include <common/macros.hpp> | |
14 | ||
c9e313bc SM |
15 | #include <lttng/condition/condition-internal.hpp> |
16 | #include <lttng/condition/evaluation-internal.hpp> | |
28f23191 | 17 | #include <lttng/condition/session-rotation.h> |
c19092cd JG |
18 | #include <lttng/location.h> |
19 | ||
20 | struct lttng_condition_session_rotation { | |
21 | struct lttng_condition parent; | |
22 | char *session_name; | |
23 | }; | |
24 | ||
25 | struct lttng_condition_session_rotation_comm { | |
26 | /* Length includes the trailing \0. */ | |
27 | uint32_t session_name_len; | |
28 | char session_name[]; | |
29 | } LTTNG_PACKED; | |
30 | ||
31 | struct lttng_evaluation_session_rotation { | |
32 | struct lttng_evaluation parent; | |
33 | uint64_t id; | |
34 | struct lttng_trace_archive_location *location; | |
35 | }; | |
36 | ||
37 | struct lttng_evaluation_session_rotation_comm { | |
38 | uint64_t id; | |
39 | uint8_t has_location; | |
40 | } LTTNG_PACKED; | |
41 | ||
28f23191 JG |
42 | ssize_t |
43 | lttng_condition_session_rotation_ongoing_create_from_payload(struct lttng_payload_view *view, | |
44 | struct lttng_condition **condition); | |
c19092cd | 45 | |
28f23191 JG |
46 | ssize_t |
47 | lttng_condition_session_rotation_completed_create_from_payload(struct lttng_payload_view *view, | |
48 | struct lttng_condition **condition); | |
c19092cd | 49 | |
28f23191 | 50 | struct lttng_evaluation *lttng_evaluation_session_rotation_ongoing_create(uint64_t id); |
c19092cd JG |
51 | |
52 | /* Ownership of location is transferred to the evaluation. */ | |
28f23191 JG |
53 | struct lttng_evaluation * |
54 | lttng_evaluation_session_rotation_completed_create(uint64_t id, | |
55 | struct lttng_trace_archive_location *location); | |
c19092cd | 56 | |
28f23191 JG |
57 | ssize_t |
58 | lttng_evaluation_session_rotation_ongoing_create_from_payload(struct lttng_payload_view *view, | |
59 | struct lttng_evaluation **evaluation); | |
c19092cd | 60 | |
c0a66c84 | 61 | ssize_t lttng_evaluation_session_rotation_completed_create_from_payload( |
28f23191 | 62 | struct lttng_payload_view *view, struct lttng_evaluation **evaluation); |
c19092cd JG |
63 | |
64 | #endif /* LTTNG_CONDITION_SESSION_ROTATION_INTERNAL_H */ |