Commit | Line | Data |
---|---|---|
af0818ef 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_KERNEL_TRACEPOINT_INTERNAL_H | |
9 | #define LTTNG_EVENT_RULE_KERNEL_TRACEPOINT_INTERNAL_H | |
10 | ||
c9e313bc SM |
11 | #include <common/macros.hpp> |
12 | #include <common/optional.hpp> | |
28f23191 JG |
13 | #include <common/payload-view.hpp> |
14 | ||
c9e313bc | 15 | #include <lttng/event-rule/event-rule-internal.hpp> |
af0818ef JR |
16 | #include <lttng/event-rule/kernel-tracepoint.h> |
17 | #include <lttng/event.h> | |
18 | ||
19 | struct lttng_event_rule_kernel_tracepoint { | |
20 | struct lttng_event_rule parent; | |
21 | ||
22 | /* Name pattern. */ | |
23 | char *pattern; | |
24 | ||
25 | /* Filter. */ | |
26 | char *filter_expression; | |
27 | ||
28 | /* internal use only. */ | |
29 | struct { | |
30 | char *filter; | |
31 | struct lttng_bytecode *bytecode; | |
32 | } internal_filter; | |
33 | }; | |
34 | ||
35 | struct lttng_event_rule_kernel_tracepoint_comm { | |
36 | /* Includes terminator `\0`. */ | |
37 | uint32_t pattern_len; | |
38 | /* Includes terminator `\0`. */ | |
39 | uint32_t filter_expression_len; | |
40 | /* | |
41 | * Payload is composed of, in that order: | |
42 | * - pattern (null terminated), | |
43 | * - filter expression (null terminated), | |
44 | */ | |
45 | char payload[]; | |
46 | } LTTNG_PACKED; | |
47 | ||
28f23191 JG |
48 | ssize_t lttng_event_rule_kernel_tracepoint_create_from_payload(struct lttng_payload_view *view, |
49 | struct lttng_event_rule **rule); | |
af0818ef JR |
50 | |
51 | #endif /* LTTNG_EVENT_RULE_KERNEL_TRACEPOINT_INTERNAL_H */ |