Move on-event*.* to event-rule-matches*.*
[lttng-tools.git] / include / lttng / condition / buffer-usage-internal.h
CommitLineData
a58c490f 1/*
ab5be9fa 2 * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
a58c490f 3 *
ab5be9fa 4 * SPDX-License-Identifier: LGPL-2.1-only
a58c490f 5 *
a58c490f
JG
6 */
7
8#ifndef LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H
9#define LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H
10
11#include <lttng/condition/buffer-usage.h>
12#include <lttng/condition/condition-internal.h>
13#include <lttng/condition/evaluation-internal.h>
14#include <lttng/domain.h>
15#include "common/buffer-view.h"
aa52c986 16#include <common/macros.h>
a58c490f
JG
17
18struct lttng_condition_buffer_usage {
19 struct lttng_condition parent;
20 struct {
21 bool set;
22 uint64_t value;
23 } threshold_bytes;
24 struct {
25 bool set;
26 double value;
27 } threshold_ratio;
28 char *session_name;
29 char *channel_name;
30 struct {
31 bool set;
32 enum lttng_domain_type type;
33 } domain;
34};
35
36struct lttng_condition_buffer_usage_comm {
37 uint8_t threshold_set_in_bytes;
38 /*
39 * Expressed in bytes if "threshold_set_in_bytes" is not 0.
40 * Otherwise, it is expressed a ratio in the interval [0.0, 1.0]
41 * that is mapped to the range on a 32-bit unsigned integer.
42 * The ratio is obtained by (threshold / UINT32_MAX).
43 */
44 uint32_t threshold;
45 /* Both lengths include the trailing \0. */
46 uint32_t session_name_len;
47 uint32_t channel_name_len;
48 /* enum lttng_domain_type */
49 int8_t domain_type;
50 /* session and channel names. */
51 char names[];
52} LTTNG_PACKED;
53
54struct lttng_evaluation_buffer_usage {
55 struct lttng_evaluation parent;
56 uint64_t buffer_use;
57 uint64_t buffer_capacity;
58};
59
60struct lttng_evaluation_buffer_usage_comm {
61 uint64_t buffer_use;
62 uint64_t buffer_capacity;
63} LTTNG_PACKED;
64
65LTTNG_HIDDEN
66struct lttng_evaluation *lttng_evaluation_buffer_usage_create(
67 enum lttng_condition_type type, uint64_t use,
68 uint64_t capacity);
69
70LTTNG_HIDDEN
c0a66c84
JG
71ssize_t lttng_condition_buffer_usage_low_create_from_payload(
72 struct lttng_payload_view *view,
a58c490f
JG
73 struct lttng_condition **condition);
74
75LTTNG_HIDDEN
c0a66c84
JG
76ssize_t lttng_condition_buffer_usage_high_create_from_payload(
77 struct lttng_payload_view *view,
a58c490f
JG
78 struct lttng_condition **condition);
79
80LTTNG_HIDDEN
c0a66c84
JG
81ssize_t lttng_evaluation_buffer_usage_low_create_from_payload(
82 struct lttng_payload_view *view,
a58c490f
JG
83 struct lttng_evaluation **evaluation);
84
85LTTNG_HIDDEN
c0a66c84
JG
86ssize_t lttng_evaluation_buffer_usage_high_create_from_payload(
87 struct lttng_payload_view *view,
a58c490f
JG
88 struct lttng_evaluation **evaluation);
89
90#endif /* LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H */
This page took 0.034653 seconds and 4 git commands to generate.