Commit | Line | Data |
---|---|---|
6d420eff 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_EVENT_RULE_TRACEPOINT_INTERNAL_H | |
9 | #define LTTNG_EVENT_RULE_TRACEPOINT_INTERNAL_H | |
10 | ||
11 | #include <common/payload-view.h> | |
12 | #include <common/macros.h> | |
85b05318 | 13 | #include <common/optional.h> |
6d420eff JR |
14 | #include <lttng/domain.h> |
15 | #include <lttng/event-rule/event-rule-internal.h> | |
16 | #include <lttng/event-rule/tracepoint.h> | |
17 | #include <lttng/event.h> | |
85b05318 | 18 | #include <lttng/log-level-rule-internal.h> |
6d420eff JR |
19 | |
20 | struct lttng_event_rule_tracepoint { | |
21 | struct lttng_event_rule parent; | |
22 | ||
23 | /* Domain. */ | |
24 | enum lttng_domain_type domain; | |
25 | ||
26 | /* Name pattern. */ | |
27 | char *pattern; | |
28 | ||
29 | /* Filter. */ | |
30 | char *filter_expression; | |
31 | ||
85b05318 JR |
32 | /* Log level. */ |
33 | struct lttng_log_level_rule *log_level_rule; | |
6d420eff JR |
34 | |
35 | /* Exclusions. */ | |
36 | struct lttng_dynamic_pointer_array exclusions; | |
37 | ||
38 | /* internal use only. */ | |
39 | struct { | |
40 | char *filter; | |
2b00d462 | 41 | struct lttng_bytecode *bytecode; |
6d420eff JR |
42 | } internal_filter; |
43 | }; | |
44 | ||
45 | struct lttng_event_rule_tracepoint_comm { | |
46 | /* enum lttng_domain_type. */ | |
47 | int8_t domain_type; | |
6d420eff JR |
48 | /* Includes terminator `\0`. */ |
49 | uint32_t pattern_len; | |
50 | /* Includes terminator `\0`. */ | |
51 | uint32_t filter_expression_len; | |
85b05318 JR |
52 | /* enum lttng_log_level_rule_comm + payload if any */ |
53 | uint32_t log_level_rule_len; | |
6d420eff JR |
54 | uint32_t exclusions_count; |
55 | uint32_t exclusions_len; | |
56 | /* | |
57 | * Payload is composed of, in that order: | |
58 | * - pattern (null terminated), | |
59 | * - filter expression (null terminated), | |
85b05318 | 60 | * - log level rule serialized object, |
6d420eff JR |
61 | * - exclusions (32 bit length + null terminated string). |
62 | */ | |
63 | char payload[]; | |
64 | } LTTNG_PACKED; | |
65 | ||
66 | LTTNG_HIDDEN | |
67 | ssize_t lttng_event_rule_tracepoint_create_from_payload( | |
68 | struct lttng_payload_view *view, | |
69 | struct lttng_event_rule **rule); | |
70 | ||
71 | #endif /* LTTNG_EVENT_RULE_TRACEPOINT_INTERNAL_H */ |