lib: compile liblttng-ctl as C++
[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 #include <lttng/lttng-export.h>
12
13 struct lttng_action;
14 struct lttng_rate_policy;
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 /*
21 * Create a newly allocated notification action object.
22 *
23 * A "notify" action will emit a notification to all clients which have an
24 * open notification channel. In order to receive this notification, clients
25 * must have subscribed to a condition equivalent to the one paired to this
26 * notify action in a trigger.
27 *
28 * The default rate policy for a notify action is a "every 1" rate policy.
29 *
30 * Returns a new action on success, NULL on failure. This action must be
31 * destroyed using lttng_action_destroy().
32 */
33 LTTNG_EXPORT extern struct lttng_action *lttng_action_notify_create(void);
34
35 /*
36 * Set the rate policy of a notify action.
37 *
38 * Returns LTTNG_ACTION_STATUS_OK on success,
39 * LTTNG_ACTION_STATUS_ERROR on internal error,
40 * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
41 */
42 LTTNG_EXPORT extern enum lttng_action_status lttng_action_notify_set_rate_policy(
43 struct lttng_action *action,
44 const struct lttng_rate_policy *policy);
45
46 /*
47 * Get the rate policy of a notify action.
48 *
49 * Returns LTTNG_ACTION_STATUS_OK on success,
50 * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
51 */
52 LTTNG_EXPORT extern enum lttng_action_status lttng_action_notify_get_rate_policy(
53 const struct lttng_action *action,
54 const struct lttng_rate_policy **policy);
55
56 #ifdef __cplusplus
57 }
58 #endif
59
60 #endif /* LTTNG_ACTION_NOTIFY_H */
This page took 0.029908 seconds and 4 git commands to generate.