Implement lttng_condition_event_rule_get_capture_bytecode_at_index
[lttng-tools.git] / include / lttng / condition / event-rule-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
8#ifndef LTTNG_CONDITION_EVENT_RULE_INTERNAL_H
9#define LTTNG_CONDITION_EVENT_RULE_INTERNAL_H
10
11#include <lttng/condition/condition-internal.h>
12#include <common/buffer-view.h>
13#include <common/macros.h>
14#include <lttng/condition/evaluation-internal.h>
38114013 15#include <common/dynamic-array.h>
683d081a 16
0912b5ea
JR
17struct lttng_capture_descriptor {
18 struct lttng_event_expr *event_expression;
19 struct lttng_bytecode *bytecode;
20};
21
683d081a
JR
22struct lttng_condition_event_rule {
23 struct lttng_condition parent;
24 struct lttng_event_rule *rule;
683d081a 25
0912b5ea 26 /* Array of `struct lttng_capture_descriptor *`. */
38114013
PP
27 struct lttng_dynamic_pointer_array capture_descriptors;
28};
683d081a
JR
29
30struct lttng_evaluation_event_rule {
31 struct lttng_evaluation parent;
32 char *name;
33};
34
35struct lttng_evaluation_event_rule_comm {
36 /* Includes the null terminator. */
37 uint32_t trigger_name_length;
38 /* Trigger name. */
39 char payload[];
40} LTTNG_PACKED;
41
683d081a
JR
42LTTNG_HIDDEN
43ssize_t lttng_condition_event_rule_create_from_payload(
44 struct lttng_payload_view *view,
45 struct lttng_condition **condition);
46
47LTTNG_HIDDEN
48enum lttng_condition_status
49lttng_condition_event_rule_borrow_rule_mutable(
50 const struct lttng_condition *condition,
51 struct lttng_event_rule **rule);
52
53LTTNG_HIDDEN
54struct lttng_evaluation *lttng_evaluation_event_rule_create(
55 const char* trigger_name);
56
57LTTNG_HIDDEN
58ssize_t lttng_evaluation_event_rule_create_from_payload(
59 struct lttng_payload_view *view,
60 struct lttng_evaluation **_evaluation);
61
834966af
JR
62LTTNG_HIDDEN
63enum lttng_error_code
64lttng_condition_event_rule_generate_capture_descriptor_bytecode(
65 struct lttng_condition *condition);
66
51dbe985
JR
67LTTNG_HIDDEN
68const struct lttng_bytecode *
69lttng_condition_event_rule_get_capture_bytecode_at_index(
70 const struct lttng_condition *condition, unsigned int index);
71
683d081a 72#endif /* LTTNG_CONDITION_EVENT_RULE_INTERNAL_H */
This page took 0.034884 seconds and 4 git commands to generate.