Coverity warning: sessiond: uncaught exception in main
[lttng-tools.git] / include / lttng / error-query-internal.hpp
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 <common/macros.hpp>
14 #include <common/payload-view.hpp>
15 #include <common/payload.hpp>
16
17 #include <lttng/lttng.h>
18
19 struct mi_writer;
20
21 enum lttng_error_query_target_type {
22 LTTNG_ERROR_QUERY_TARGET_TYPE_TRIGGER,
23 LTTNG_ERROR_QUERY_TARGET_TYPE_CONDITION,
24 LTTNG_ERROR_QUERY_TARGET_TYPE_ACTION,
25 };
26
27 enum lttng_error_query_target_type
28 lttng_error_query_get_target_type(const struct lttng_error_query *query);
29
30 const struct lttng_trigger *
31 lttng_error_query_trigger_borrow_target(const struct lttng_error_query *query);
32
33 const struct lttng_trigger *
34 lttng_error_query_condition_borrow_target(const struct lttng_error_query *query);
35
36 const struct lttng_trigger *
37 lttng_error_query_action_borrow_trigger_target(const struct lttng_error_query *query);
38
39 struct lttng_action *
40 lttng_error_query_action_borrow_action_target(const struct lttng_error_query *query,
41 struct lttng_trigger *trigger);
42
43 int lttng_error_query_serialize(const struct lttng_error_query *query,
44 struct lttng_payload *payload);
45
46 ssize_t lttng_error_query_create_from_payload(struct lttng_payload_view *view,
47 struct lttng_error_query **query);
48
49 int lttng_error_query_result_serialize(const struct lttng_error_query_result *result,
50 struct lttng_payload *payload);
51
52 ssize_t lttng_error_query_result_create_from_payload(struct lttng_payload_view *view,
53 struct lttng_error_query_result **result);
54
55 int lttng_error_query_results_serialize(const struct lttng_error_query_results *results,
56 struct lttng_payload *payload);
57
58 ssize_t lttng_error_query_results_create_from_payload(struct lttng_payload_view *view,
59 struct lttng_error_query_results **results);
60
61 struct lttng_error_query_result *
62 lttng_error_query_result_counter_create(const char *name, const char *description, uint64_t value);
63
64 void lttng_error_query_result_destroy(struct lttng_error_query_result *result);
65
66 struct lttng_error_query_results *lttng_error_query_results_create();
67
68 /* Ownership of `result` is transferred on success. */
69 int lttng_error_query_results_add_result(struct lttng_error_query_results *results,
70 struct lttng_error_query_result *result);
71
72 enum lttng_error_code
73 lttng_error_query_results_mi_serialize(const struct lttng_error_query_results *results,
74 struct mi_writer *writer);
75
76 #endif /* LTTNG_ERROR_QUERY_INTERNAL_H */
This page took 0.031101 seconds and 4 git commands to generate.