Commit | Line | Data |
---|---|---|
85b05318 JR |
1 | /* |
2 | * Copyright (C) 2020 Jonathan Rajotte <jonathan.rajotte-julien@efficios.com> | |
3 | * | |
4 | * SPDX-License-Identifier: LGPL-2.1-only | |
5 | * | |
6 | */ | |
7 | ||
8 | #ifndef LTTNG_LOG_LEVEL_RULE_INTERNAL_H | |
9 | #define LTTNG_LOG_LEVEL_RULE_INTERNAL_H | |
10 | ||
11 | #include <stdint.h> | |
12 | ||
13 | #include <common/buffer-view.h> | |
14 | #include <common/dynamic-array.h> | |
15 | #include <common/macros.h> | |
16 | #include <common/payload-view.h> | |
17 | #include <common/payload.h> | |
18 | #include <lttng/event.h> | |
19 | #include <lttng/log-level-rule.h> | |
20 | ||
21 | /* | |
22 | * For now only a single backing struct is used for both type of log level | |
23 | * rule (exactly, as_severe) since both only have require "level" as property. | |
24 | */ | |
25 | struct lttng_log_level_rule { | |
26 | enum lttng_log_level_rule_type type; | |
27 | int level; | |
28 | }; | |
29 | ||
30 | struct lttng_log_level_rule_comm { | |
31 | /* enum lttng_log_level_rule_type */ | |
32 | int8_t type; | |
33 | int32_t level; | |
34 | }; | |
35 | ||
36 | LTTNG_HIDDEN | |
37 | ssize_t lttng_log_level_rule_create_from_payload( | |
38 | struct lttng_payload_view *view, | |
39 | struct lttng_log_level_rule **rule); | |
40 | ||
41 | LTTNG_HIDDEN | |
42 | int lttng_log_level_rule_serialize(const struct lttng_log_level_rule *rule, | |
43 | struct lttng_payload *payload); | |
44 | ||
45 | LTTNG_HIDDEN | |
46 | bool lttng_log_level_rule_is_equal(const struct lttng_log_level_rule *a, | |
47 | const struct lttng_log_level_rule *b); | |
48 | ||
49 | LTTNG_HIDDEN | |
50 | struct lttng_log_level_rule *lttng_log_level_rule_copy( | |
51 | const struct lttng_log_level_rule *source); | |
52 | ||
53 | LTTNG_HIDDEN | |
54 | void lttng_log_level_rule_to_loglevel( | |
55 | const struct lttng_log_level_rule *log_level_rule, | |
56 | enum lttng_loglevel_type *loglevel_type, | |
57 | int *loglevel_value); | |
58 | ||
59 | LTTNG_HIDDEN | |
60 | unsigned long lttng_log_level_rule_hash( | |
61 | const struct lttng_log_level_rule *log_level_rule); | |
62 | ||
63 | #endif /* LTTNG_LOG_LEVEL_RULE_INTERNAL_H */ |