Clean-up: run format-cpp on the tree
[lttng-tools.git] / include / lttng / condition / event-rule-matches-internal.hpp
... / ...
CommitLineData
1/*
2 * Copyright (C) 2019 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8#ifndef LTTNG_CONDITION_EVENT_RULE_MATCHES_INTERNAL_H
9#define LTTNG_CONDITION_EVENT_RULE_MATCHES_INTERNAL_H
10
11#include <common/buffer-view.hpp>
12#include <common/dynamic-array.hpp>
13#include <common/macros.hpp>
14#include <common/optional.hpp>
15
16#include <lttng/condition/condition-internal.hpp>
17#include <lttng/condition/evaluation-internal.hpp>
18#include <lttng/event-field-value.h>
19
20struct lttng_capture_descriptor {
21 struct lttng_event_expr *event_expression;
22 struct lttng_bytecode *bytecode;
23};
24
25struct lttng_condition_event_rule_matches {
26 struct lttng_condition parent;
27 struct lttng_event_rule *rule;
28
29 /*
30 * Internal use only.
31 * Error accounting counter index.
32 */
33 LTTNG_OPTIONAL(uint64_t) error_counter_index;
34
35 /* Array of `struct lttng_capture_descriptor *`. */
36 struct lttng_dynamic_pointer_array capture_descriptors;
37};
38
39struct lttng_evaluation_event_rule_matches {
40 struct lttng_evaluation parent;
41
42 /* MessagePack-encoded captured event field values. */
43 struct lttng_dynamic_buffer capture_payload;
44
45 /*
46 * The content of this array event field value is the decoded
47 * version of `capture_payload` above.
48 *
49 * This is a cache: it's not serialized/deserialized in
50 * communications from/to the library and the session daemon.
51 */
52 struct lttng_event_field_value *captured_values;
53};
54
55ssize_t lttng_condition_event_rule_matches_create_from_payload(struct lttng_payload_view *view,
56 struct lttng_condition **condition);
57
58enum lttng_condition_status
59lttng_condition_event_rule_matches_borrow_rule_mutable(const struct lttng_condition *condition,
60 struct lttng_event_rule **rule);
61
62void lttng_condition_event_rule_matches_set_error_counter_index(struct lttng_condition *condition,
63 uint64_t error_counter_index);
64
65uint64_t
66lttng_condition_event_rule_matches_get_error_counter_index(const struct lttng_condition *condition);
67
68struct lttng_evaluation *lttng_evaluation_event_rule_matches_create(
69 const struct lttng_condition_event_rule_matches *condition,
70 const char *capture_payload,
71 size_t capture_payload_size,
72 bool decode_capture_payload);
73
74ssize_t lttng_evaluation_event_rule_matches_create_from_payload(
75 const struct lttng_condition_event_rule_matches *condition,
76 struct lttng_payload_view *view,
77 struct lttng_evaluation **_evaluation);
78
79enum lttng_error_code lttng_condition_event_rule_matches_generate_capture_descriptor_bytecode(
80 struct lttng_condition *condition);
81
82const struct lttng_bytecode *lttng_condition_event_rule_matches_get_capture_bytecode_at_index(
83 const struct lttng_condition *condition, unsigned int index);
84
85#endif /* LTTNG_CONDITION_EVENT_RULE_MATCHES_INTERNAL_H */
This page took 0.022605 seconds and 4 git commands to generate.