2 * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H
9 #define LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H
11 #include "common/buffer-view.hpp"
13 #include <common/macros.hpp>
15 #include <lttng/condition/buffer-usage.h>
16 #include <lttng/condition/condition-internal.hpp>
17 #include <lttng/condition/evaluation-internal.hpp>
18 #include <lttng/domain.h>
20 struct lttng_condition_buffer_usage {
21 struct lttng_condition parent;
34 enum lttng_domain_type type;
38 struct lttng_condition_buffer_usage_comm {
39 uint8_t threshold_set_in_bytes;
40 uint64_t threshold_bytes;
41 double threshold_ratio;
42 /* Both lengths include the trailing \0. */
43 uint32_t session_name_len;
44 uint32_t channel_name_len;
45 /* enum lttng_domain_type */
47 /* session and channel names. */
51 struct lttng_evaluation_buffer_usage {
52 struct lttng_evaluation parent;
54 uint64_t buffer_capacity;
57 struct lttng_evaluation_buffer_usage_comm {
59 uint64_t buffer_capacity;
62 struct lttng_evaluation *lttng_evaluation_buffer_usage_create(enum lttng_condition_type type,
66 ssize_t lttng_condition_buffer_usage_low_create_from_payload(struct lttng_payload_view *view,
67 struct lttng_condition **condition);
69 ssize_t lttng_condition_buffer_usage_high_create_from_payload(struct lttng_payload_view *view,
70 struct lttng_condition **condition);
72 ssize_t lttng_evaluation_buffer_usage_low_create_from_payload(struct lttng_payload_view *view,
73 struct lttng_evaluation **evaluation);
76 lttng_evaluation_buffer_usage_high_create_from_payload(struct lttng_payload_view *view,
77 struct lttng_evaluation **evaluation);
79 #endif /* LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H */