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