Implement firing policy for the notify action
[lttng-tools.git] / include / lttng / action / notify.h
1 /*
2 * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8 #ifndef LTTNG_ACTION_NOTIFY_H
9 #define LTTNG_ACTION_NOTIFY_H
10
11 struct lttng_action;
12 struct lttng_firing_policy;
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
18 /*
19 * Create a newly allocated notification action object.
20 *
21 * A "notify" action will emit a notification to all clients which have an
22 * open notification channel. In order to receive this notification, clients
23 * must have subscribed to a condition equivalent to the one paired to this
24 * notify action in a trigger.
25 *
26 * The default firing policy for a notify action is a "every 1" firing policy.
27 *
28 * Returns a new action on success, NULL on failure. This action must be
29 * destroyed using lttng_action_destroy().
30 */
31 extern struct lttng_action *lttng_action_notify_create(void);
32
33 /*
34 * Set the firing policy of a notify action.
35 *
36 * Returns LTTNG_ACTION_STATUS_OK on success,
37 * LTTNG_ACTION_STATUS_ERROR on internal error,
38 * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
39 */
40 extern enum lttng_action_status lttng_action_notify_set_firing_policy(
41 struct lttng_action *action,
42 const struct lttng_firing_policy *policy);
43
44 /*
45 * Get the firing policy of a notify action.
46 *
47 * Returns LTTNG_ACTION_STATUS_OK on success,
48 * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
49 */
50 extern enum lttng_action_status lttng_action_notify_get_firing_policy(
51 const struct lttng_action *action,
52 const struct lttng_firing_policy **policy);
53
54 #ifdef __cplusplus
55 }
56 #endif
57
58 #endif /* LTTNG_ACTION_NOTIFY_H */
This page took 0.032549 seconds and 5 git commands to generate.