File: buffer-usage-internal.hpp

package info (click to toggle)
ltt-control 2.15.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,744 kB
  • sloc: cpp: 207,706; sh: 28,837; python: 18,952; ansic: 11,636; makefile: 3,362; java: 109; xml: 46
file content (79 lines) | stat: -rw-r--r-- 2,147 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
 * SPDX-FileCopyrightText: 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
 *
 * SPDX-License-Identifier: LGPL-2.1-only
 *
 */

#ifndef LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H
#define LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H

#include "common/buffer-view.hpp"

#include <common/macros.hpp>

#include <lttng/condition/buffer-usage.h>
#include <lttng/condition/condition-internal.hpp>
#include <lttng/condition/evaluation-internal.hpp>
#include <lttng/domain.h>

struct lttng_condition_buffer_usage {
	struct lttng_condition parent;
	struct {
		bool set;
		uint64_t value;
	} threshold_bytes;
	struct {
		bool set;
		double value;
	} threshold_ratio;
	char *session_name;
	char *channel_name;
	struct {
		bool set;
		enum lttng_domain_type type;
	} domain;
};

struct lttng_condition_buffer_usage_comm {
	uint8_t threshold_set_in_bytes;
	uint64_t threshold_bytes;
	double threshold_ratio;
	/* Both lengths include the trailing \0. */
	uint32_t session_name_len;
	uint32_t channel_name_len;
	/* enum lttng_domain_type */
	int8_t domain_type;
	/* session and channel names. */
	char names[];
} LTTNG_PACKED;

struct lttng_evaluation_buffer_usage {
	struct lttng_evaluation parent;
	uint64_t buffer_use;
	uint64_t buffer_capacity;
};

struct lttng_evaluation_buffer_usage_comm {
	uint64_t buffer_use;
	uint64_t buffer_capacity;
} LTTNG_PACKED;

struct lttng_evaluation *lttng_evaluation_buffer_usage_create(enum lttng_condition_type type,
							      uint64_t use,
							      uint64_t capacity);

ssize_t lttng_condition_buffer_usage_low_create_from_payload(struct lttng_payload_view *view,
							     struct lttng_condition **condition);

ssize_t lttng_condition_buffer_usage_high_create_from_payload(struct lttng_payload_view *view,
							      struct lttng_condition **condition);

ssize_t lttng_evaluation_buffer_usage_low_create_from_payload(struct lttng_payload_view *view,
							      struct lttng_evaluation **evaluation);

ssize_t
lttng_evaluation_buffer_usage_high_create_from_payload(struct lttng_payload_view *view,
						       struct lttng_evaluation **evaluation);

#endif /* LTTNG_CONDITION_BUFFER_USAGE_INTERNAL_H */