#include <common/buffer-view.h>
#include <common/macros.h>
#include <lttng/condition/evaluation-internal.h>
+#include <common/dynamic-array.h>
+
+struct lttng_capture_descriptor {
+ struct lttng_event_expr *event_expression;
+ struct lttng_bytecode *bytecode;
+};
struct lttng_condition_event_rule {
struct lttng_condition parent;
struct lttng_event_rule *rule;
-};
-struct lttng_condition_event_rule_comm {
- /* length excludes the header's length. */
- uint32_t event_rule_length;
- /* Event rule follows. */
- char payload[];
-} LTTNG_PACKED;
+ /* Array of `struct lttng_capture_descriptor *`. */
+ struct lttng_dynamic_pointer_array capture_descriptors;
+};
struct lttng_evaluation_event_rule {
struct lttng_evaluation parent;
char payload[];
} LTTNG_PACKED;
-
LTTNG_HIDDEN
ssize_t lttng_condition_event_rule_create_from_payload(
struct lttng_payload_view *view,
struct lttng_payload_view *view,
struct lttng_evaluation **_evaluation);
+LTTNG_HIDDEN
+enum lttng_error_code
+lttng_condition_event_rule_generate_capture_descriptor_bytecode(
+ struct lttng_condition *condition);
+
+LTTNG_HIDDEN
+const struct lttng_bytecode *
+lttng_condition_event_rule_get_capture_bytecode_at_index(
+ const struct lttng_condition *condition, unsigned int index);
+
#endif /* LTTNG_CONDITION_EVENT_RULE_INTERNAL_H */