lib: compile liblttng-ctl as C++
[lttng-tools.git] / include / lttng / action / notify.h
CommitLineData
a58c490f 1/*
ab5be9fa 2 * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
a58c490f 3 *
ab5be9fa 4 * SPDX-License-Identifier: LGPL-2.1-only
a58c490f 5 *
a58c490f
JG
6 */
7
8#ifndef LTTNG_ACTION_NOTIFY_H
9#define LTTNG_ACTION_NOTIFY_H
10
4bd69c5f
SM
11#include <lttng/lttng-export.h>
12
a58c490f 13struct lttng_action;
7f4d5b07 14struct lttng_rate_policy;
a58c490f
JG
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
a109f1c6
JG
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 *
7f4d5b07 28 * The default rate policy for a notify action is a "every 1" rate policy.
1c2c1c05 29 *
a109f1c6
JG
30 * Returns a new action on success, NULL on failure. This action must be
31 * destroyed using lttng_action_destroy().
32 */
4bd69c5f 33LTTNG_EXPORT extern struct lttng_action *lttng_action_notify_create(void);
a58c490f 34
1c2c1c05 35/*
7f4d5b07 36 * Set the rate policy of a notify action.
1c2c1c05
JR
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 */
4bd69c5f 42LTTNG_EXPORT extern enum lttng_action_status lttng_action_notify_set_rate_policy(
1c2c1c05 43 struct lttng_action *action,
7f4d5b07 44 const struct lttng_rate_policy *policy);
1c2c1c05
JR
45
46/*
7f4d5b07 47 * Get the rate policy of a notify action.
1c2c1c05
JR
48 *
49 * Returns LTTNG_ACTION_STATUS_OK on success,
50 * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
51 */
4bd69c5f 52LTTNG_EXPORT extern enum lttng_action_status lttng_action_notify_get_rate_policy(
1c2c1c05 53 const struct lttng_action *action,
7f4d5b07 54 const struct lttng_rate_policy **policy);
1c2c1c05 55
a58c490f
JG
56#ifdef __cplusplus
57}
58#endif
59
60#endif /* LTTNG_ACTION_NOTIFY_H */
This page took 0.035764 seconds and 4 git commands to generate.