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