fix: relayd: unaligned access in trace_chunk_registry_ht_key_hash
[lttng-tools.git] / include / lttng / condition / buffer-usage-internal.hpp
1 /*
2 * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8 #ifndef LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H
9 #define LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H
10
11 #include "common/buffer-view.hpp"
12
13 #include <common/macros.hpp>
14
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>
19
20 struct lttng_condition_buffer_usage {
21 struct lttng_condition parent;
22 struct {
23 bool set;
24 uint64_t value;
25 } threshold_bytes;
26 struct {
27 bool set;
28 double value;
29 } threshold_ratio;
30 char *session_name;
31 char *channel_name;
32 struct {
33 bool set;
34 enum lttng_domain_type type;
35 } domain;
36 };
37
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 */
46 int8_t domain_type;
47 /* session and channel names. */
48 char names[];
49 } LTTNG_PACKED;
50
51 struct lttng_evaluation_buffer_usage {
52 struct lttng_evaluation parent;
53 uint64_t buffer_use;
54 uint64_t buffer_capacity;
55 };
56
57 struct lttng_evaluation_buffer_usage_comm {
58 uint64_t buffer_use;
59 uint64_t buffer_capacity;
60 } LTTNG_PACKED;
61
62 struct lttng_evaluation *lttng_evaluation_buffer_usage_create(enum lttng_condition_type type,
63 uint64_t use,
64 uint64_t capacity);
65
66 ssize_t lttng_condition_buffer_usage_low_create_from_payload(struct lttng_payload_view *view,
67 struct lttng_condition **condition);
68
69 ssize_t lttng_condition_buffer_usage_high_create_from_payload(struct lttng_payload_view *view,
70 struct lttng_condition **condition);
71
72 ssize_t lttng_evaluation_buffer_usage_low_create_from_payload(struct lttng_payload_view *view,
73 struct lttng_evaluation **evaluation);
74
75 ssize_t
76 lttng_evaluation_buffer_usage_high_create_from_payload(struct lttng_payload_view *view,
77 struct lttng_evaluation **evaluation);
78
79 #endif /* LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H */
This page took 0.029918 seconds and 4 git commands to generate.