X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Ferror-query.h;h=0eb0addc8a161273290bb58412b00efab8e3d67f;hb=28f23191dcbf047429d51950a337a57d7a3f866a;hp=382f2cad582d9e70eab389c56fea4833f4bd28f9;hpb=b99a0cb3edd93f55e712096a352d64b79d4716bb;p=lttng-tools.git diff --git a/include/lttng/error-query.h b/include/lttng/error-query.h index 382f2cad5..0eb0addc8 100644 --- a/include/lttng/error-query.h +++ b/include/lttng/error-query.h @@ -10,8 +10,10 @@ #ifndef LTTNG_ERROR_QUERY_H #define LTTNG_ERROR_QUERY_H +#include #include #include + #include #ifdef __cplusplus @@ -58,16 +60,25 @@ enum lttng_error_query_results_status { }; /* 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. */ +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. */ -extern struct lttng_error_query *lttng_error_query_action_create( - const struct lttng_trigger *trigger, - const struct lttng_action *action); +/* + * Create an error query targetting an action object. + * + * `action_path` is copied internally. The root of the `action_path` is the + * action of `trigger`. + */ +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. @@ -75,47 +86,43 @@ extern void lttng_error_query_destroy(struct lttng_error_query *query); * 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 }