*
* Copyright (C) 2021 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
- * SPDX-License-Identifier: GPL-2.1-only
+ * SPDX-License-Identifier: LGPL-2.1-only
*
*/
#ifndef LTTNG_ERROR_QUERY_H
#define LTTNG_ERROR_QUERY_H
+#include <lttng/lttng-export.h>
#include <lttng/lttng.h>
#include <lttng/trigger/trigger.h>
+
#include <stdint.h>
#ifdef __cplusplus
};
/* Create an error query targetting a trigger object. */
-extern struct lttng_error_query *lttng_error_query_trigger_create(
- const struct lttng_trigger *trigger);
+LTTNG_EXPORT extern struct lttng_error_query *
+lttng_error_query_trigger_create(const struct lttng_trigger *trigger);
/* Create an error query targetting a trigger's condition object. */
-extern struct lttng_error_query *lttng_error_query_condition_create(
- const struct lttng_trigger *trigger);
+LTTNG_EXPORT extern struct lttng_error_query *
+lttng_error_query_condition_create(const struct lttng_trigger *trigger);
/*
* Create an error query targetting an action object.
* `action_path` is copied internally. The root of the `action_path` is the
* action of `trigger`.
*/
-extern struct lttng_error_query *lttng_error_query_action_create(
- const struct lttng_trigger *trigger,
- const struct lttng_action_path *action_path);
+LTTNG_EXPORT extern struct lttng_error_query *
+lttng_error_query_action_create(const struct lttng_trigger *trigger,
+ const struct lttng_action_path *action_path);
/* Destroy an error query. */
-extern void lttng_error_query_destroy(struct lttng_error_query *query);
+LTTNG_EXPORT extern void lttng_error_query_destroy(struct lttng_error_query *query);
/*
* Run an error query against an endpoint.
* Currently, only the `lttng_session_daemon_command_endpoint` is supported,
* see `lttng/endpoint.h`.
*/
-extern enum lttng_error_code lttng_error_query_execute(
- const struct lttng_error_query *query,
- const struct lttng_endpoint *endpoint,
- struct lttng_error_query_results **results);
+LTTNG_EXPORT extern enum lttng_error_code
+lttng_error_query_execute(const struct lttng_error_query *query,
+ const struct lttng_endpoint *endpoint,
+ struct lttng_error_query_results **results);
/* Get the number of results in a result set. */
-extern enum lttng_error_query_results_status
-lttng_error_query_results_get_count(
- const struct lttng_error_query_results *results,
- unsigned int *count);
+LTTNG_EXPORT LTTNG_EXPORT extern enum lttng_error_query_results_status
+lttng_error_query_results_get_count(const struct lttng_error_query_results *results,
+ unsigned int *count);
/* Get a result from a result set by index. */
-extern enum lttng_error_query_results_status
-lttng_error_query_results_get_result(
- const struct lttng_error_query_results *results,
- const struct lttng_error_query_result **result,
- unsigned int index);
+LTTNG_EXPORT extern enum lttng_error_query_results_status
+lttng_error_query_results_get_result(const struct lttng_error_query_results *results,
+ const struct lttng_error_query_result **result,
+ unsigned int index);
/* Destroy an error query result set. */
-extern void lttng_error_query_results_destroy(
- struct lttng_error_query_results *results);
+LTTNG_EXPORT extern void
+lttng_error_query_results_destroy(struct lttng_error_query_results *results);
/* Get the type of an error query result. */
-extern enum lttng_error_query_result_type lttng_error_query_result_get_type(
- const struct lttng_error_query_result *result);
+LTTNG_EXPORT extern enum lttng_error_query_result_type
+lttng_error_query_result_get_type(const struct lttng_error_query_result *result);
/* Get the name of result. */
-extern enum lttng_error_query_result_status lttng_error_query_result_get_name(
- const struct lttng_error_query_result *result,
- const char **name);
+LTTNG_EXPORT extern enum lttng_error_query_result_status
+lttng_error_query_result_get_name(const struct lttng_error_query_result *result, const char **name);
/* Get the description of a result. */
-extern enum lttng_error_query_result_status
-lttng_error_query_result_get_description(
- const struct lttng_error_query_result *result,
- const char **description);
+LTTNG_EXPORT extern enum lttng_error_query_result_status
+lttng_error_query_result_get_description(const struct lttng_error_query_result *result,
+ const char **description);
/* Get the value of an error counter. */
-extern enum lttng_error_query_result_status
-lttng_error_query_result_counter_get_value(
- const struct lttng_error_query_result *result, uint64_t *value);
+LTTNG_EXPORT extern enum lttng_error_query_result_status
+lttng_error_query_result_counter_get_value(const struct lttng_error_query_result *result,
+ uint64_t *value);
#ifdef __cplusplus
}