condition: implement event rule based condition
[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>
15
16struct lttng_condition_event_rule {
17 struct lttng_condition parent;
18 struct lttng_event_rule *rule;
19};
20
21struct lttng_condition_event_rule_comm {
22 /* length excludes the header's length. */
23 uint32_t event_rule_length;
24 /* Event rule follows. */
25 char payload[];
26} LTTNG_PACKED;
27
28struct lttng_evaluation_event_rule {
29 struct lttng_evaluation parent;
30 char *name;
31};
32
33struct lttng_evaluation_event_rule_comm {
34 /* Includes the null terminator. */
35 uint32_t trigger_name_length;
36 /* Trigger name. */
37 char payload[];
38} LTTNG_PACKED;
39
40
41LTTNG_HIDDEN
42ssize_t lttng_condition_event_rule_create_from_payload(
43 struct lttng_payload_view *view,
44 struct lttng_condition **condition);
45
46LTTNG_HIDDEN
47enum lttng_condition_status
48lttng_condition_event_rule_borrow_rule_mutable(
49 const struct lttng_condition *condition,
50 struct lttng_event_rule **rule);
51
52LTTNG_HIDDEN
53struct lttng_evaluation *lttng_evaluation_event_rule_create(
54 const char* trigger_name);
55
56LTTNG_HIDDEN
57ssize_t lttng_evaluation_event_rule_create_from_payload(
58 struct lttng_payload_view *view,
59 struct lttng_evaluation **_evaluation);
60
61#endif /* LTTNG_CONDITION_EVENT_RULE_INTERNAL_H */
This page took 0.024727 seconds and 4 git commands to generate.