Commit | Line | Data |
---|---|---|
b99a0cb3 JG |
1 | /* |
2 | * error-query-internal.h | |
3 | * | |
4 | * Copyright (C) 2021 Jérémie Galarneau <jeremie.galarneau@efficios.com> | |
5 | * | |
6 | * SPDX-License-Identifier: GPL-2.1-only | |
7 | * | |
8 | */ | |
9 | ||
10 | #ifndef LTTNG_ERROR_QUERY_INTERNAL_H | |
11 | #define LTTNG_ERROR_QUERY_INTERNAL_H | |
12 | ||
13 | #include <lttng/lttng.h> | |
14 | #include <common/macros.h> | |
15 | #include <common/payload.h> | |
16 | #include <common/payload-view.h> | |
17 | ||
18 | enum lttng_error_query_target_type { | |
19 | LTTNG_ERROR_QUERY_TARGET_TYPE_TRIGGER, | |
20 | LTTNG_ERROR_QUERY_TARGET_TYPE_ACTION, | |
21 | }; | |
22 | ||
23 | LTTNG_HIDDEN | |
24 | enum lttng_error_query_target_type lttng_error_query_get_target_type( | |
25 | const struct lttng_error_query *query); | |
26 | ||
27 | LTTNG_HIDDEN | |
28 | const struct lttng_trigger *lttng_error_query_trigger_borrow_target( | |
29 | const struct lttng_error_query *query); | |
30 | ||
31 | LTTNG_HIDDEN | |
32 | const struct lttng_trigger *lttng_error_query_action_borrow_trigger_target( | |
33 | const struct lttng_error_query *query); | |
34 | ||
35 | LTTNG_HIDDEN | |
588c4b0d | 36 | struct lttng_action *lttng_error_query_action_borrow_action_target( |
b99a0cb3 | 37 | const struct lttng_error_query *query, |
588c4b0d | 38 | struct lttng_trigger *trigger); |
b99a0cb3 JG |
39 | |
40 | LTTNG_HIDDEN | |
41 | int lttng_error_query_serialize(const struct lttng_error_query *query, | |
42 | struct lttng_payload *payload); | |
43 | ||
44 | LTTNG_HIDDEN | |
45 | ssize_t lttng_error_query_create_from_payload(struct lttng_payload_view *view, | |
46 | struct lttng_error_query **query); | |
47 | ||
48 | LTTNG_HIDDEN | |
49 | int lttng_error_query_result_serialize( | |
50 | const struct lttng_error_query_result *result, | |
51 | struct lttng_payload *payload); | |
52 | ||
53 | LTTNG_HIDDEN | |
54 | ssize_t lttng_error_query_result_create_from_payload( | |
55 | struct lttng_payload_view *view, | |
56 | struct lttng_error_query_result **result); | |
57 | ||
58 | LTTNG_HIDDEN | |
59 | int lttng_error_query_results_serialize( | |
60 | const struct lttng_error_query_results *results, | |
61 | struct lttng_payload *payload); | |
62 | ||
63 | LTTNG_HIDDEN | |
64 | ssize_t lttng_error_query_results_create_from_payload( | |
65 | struct lttng_payload_view *view, | |
66 | struct lttng_error_query_results **results); | |
67 | ||
68 | LTTNG_HIDDEN | |
69 | struct lttng_error_query_result * | |
70 | lttng_error_query_result_counter_create( | |
71 | const char *name, const char *description, uint64_t value); | |
72 | ||
73 | LTTNG_HIDDEN | |
74 | void lttng_error_query_result_destroy(struct lttng_error_query_result *result); | |
75 | ||
76 | LTTNG_HIDDEN | |
77 | struct lttng_error_query_results *lttng_error_query_results_create(void); | |
78 | ||
79 | /* Ownership of `result` is transferred on success. */ | |
80 | LTTNG_HIDDEN | |
81 | int lttng_error_query_results_add_result( | |
82 | struct lttng_error_query_results *results, | |
83 | struct lttng_error_query_result *result); | |
84 | ||
85 | #endif /* LTTNG_ERROR_QUERY_INTERNAL_H */ |