21a99eb7e21c567ebe9ee17ea448d7f998a45e7c
[lttng-tools.git] / include / lttng / event-rule / jul-logging-internal.h
1 /*
2 * Copyright (C) 2021 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8 #ifndef LTTNG_EVENT_RULE_JUL_LOGGING_INTERNAL_H
9 #define LTTNG_EVENT_RULE_JUL_LOGGING_INTERNAL_H
10
11 #include <common/payload-view.h>
12 #include <common/macros.h>
13 #include <common/optional.h>
14 #include <lttng/event-rule/event-rule-internal.h>
15 #include <lttng/event-rule/jul-logging.h>
16 #include <lttng/event.h>
17 #include <lttng/log-level-rule-internal.h>
18
19 struct lttng_event_rule_jul_logging {
20 struct lttng_event_rule parent;
21
22 /* Name pattern. */
23 char *pattern;
24
25 /* Filter. */
26 char *filter_expression;
27
28 /* Log level. */
29 struct lttng_log_level_rule *log_level_rule;
30
31 /* internal use only. */
32 struct {
33 char *filter;
34 struct lttng_bytecode *bytecode;
35 } internal_filter;
36 };
37
38 struct lttng_event_rule_jul_logging_comm {
39 /* Includes terminator `\0`. */
40 uint32_t pattern_len;
41 /* Includes terminator `\0`. */
42 uint32_t filter_expression_len;
43 /* enum lttng_log_level_rule_comm + payload if any */
44 uint32_t log_level_rule_len;
45 /*
46 * Payload is composed of, in that order:
47 * - pattern (null terminated),
48 * - filter expression (null terminated),
49 * - log level rule serialized object,
50 */
51 char payload[];
52 } LTTNG_PACKED;
53
54 ssize_t lttng_event_rule_jul_logging_create_from_payload(
55 struct lttng_payload_view *view,
56 struct lttng_event_rule **rule);
57
58 #endif /* LTTNG_EVENT_RULE_JUL_LOGGING_INTERNAL_H */
This page took 0.029622 seconds and 3 git commands to generate.