X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Faction-executor.hpp;fp=src%2Fbin%2Flttng-sessiond%2Faction-executor.hpp;h=85d5931fedb9fa09188652d0646036f9fc9d08da;hp=0000000000000000000000000000000000000000;hb=c9e313bc594f40a86eed237dce222c0fc99c957f;hpb=4878de5c7deb512bbdac4fdfc498907efa06fb7c diff --git a/src/bin/lttng-sessiond/action-executor.hpp b/src/bin/lttng-sessiond/action-executor.hpp new file mode 100644 index 000000000..85d5931fe --- /dev/null +++ b/src/bin/lttng-sessiond/action-executor.hpp @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2020 Jérémie Galarneau + * + * SPDX-License-Identifier: GPL-2.0-only + * + */ + +#ifndef ACTION_EXECUTOR_H +#define ACTION_EXECUTOR_H + +struct action_executor; +struct notification_thread_handle; +struct lttng_evaluation; +struct lttng_trigger; +struct notification_client_list; +struct lttng_credentials; + +enum action_executor_status { + ACTION_EXECUTOR_STATUS_OK, + ACTION_EXECUTOR_STATUS_OVERFLOW, + ACTION_EXECUTOR_STATUS_ERROR, + ACTION_EXECUTOR_STATUS_INVALID, +}; + +struct action_executor *action_executor_create( + struct notification_thread_handle *handle); + +void action_executor_destroy(struct action_executor *executor); + +/* + * Enqueue a job on an action executor's work queue to perform the actions + * associated with a trigger. + * + * A reference to `trigger` is acquired. + * A reference to `list` is acquired. + * + * This function assumes the ownership of the `evaluation` both on success and + * failure: the caller should no longer access it once the function returns. + */ +enum action_executor_status action_executor_enqueue_trigger( + struct action_executor *executor, + struct lttng_trigger *trigger, + struct lttng_evaluation *evaluation, + const struct lttng_credentials *object_creds, + struct notification_client_list *list); + +#endif /* ACTION_EXECUTOR_H */