2 * Copyright (C) 2021 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef LTTNG_EVENT_RULE_PYTHON_LOGGING_INTERNAL_H
9 #define LTTNG_EVENT_RULE_PYTHON_LOGGING_INTERNAL_H
11 #include <common/macros.hpp>
12 #include <common/optional.hpp>
13 #include <common/payload-view.hpp>
15 #include <lttng/event-rule/event-rule-internal.hpp>
16 #include <lttng/event-rule/python-logging.h>
17 #include <lttng/event.h>
18 #include <lttng/log-level-rule-internal.hpp>
20 struct lttng_event_rule_python_logging {
21 struct lttng_event_rule parent;
27 char *filter_expression;
30 struct lttng_log_level_rule *log_level_rule;
32 /* internal use only. */
35 struct lttng_bytecode *bytecode;
39 struct lttng_event_rule_python_logging_comm {
40 /* Includes terminator `\0`. */
42 /* Includes terminator `\0`. */
43 uint32_t filter_expression_len;
44 /* enum lttng_log_level_rule_comm + payload if any */
45 uint32_t log_level_rule_len;
47 * Payload is composed of, in that order:
48 * - pattern (null terminated),
49 * - filter expression (null terminated),
50 * - log level rule serialized object,
55 ssize_t lttng_event_rule_python_logging_create_from_payload(struct lttng_payload_view *view,
56 struct lttng_event_rule **rule);
58 #endif /* LTTNG_EVENT_RULE_PYTHON_LOGGING_INTERNAL_H */