Rename firing policy to rate policy
[lttng-tools.git] / include / lttng / action / snapshot-session.h
CommitLineData
757c48a2
SM
1/*
2 * Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-only
5 *
6 */
7
8#ifndef LTTNG_ACTION_SNAPSHOT_SESSION_H
9#define LTTNG_ACTION_SNAPSHOT_SESSION_H
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15struct lttng_action;
16struct lttng_snapshot_output;
7f4d5b07 17struct lttng_rate_policy;
757c48a2
SM
18
19/*
20 * Create a newly allocated snapshot-session action object.
21 *
22 * A snapshot session action object must have a session name set to be
23 * considered valid when used with a trigger object (lttng_trigger). A name can
24 * be set using `lttng_action_snapshot_session_set_session_name`.
25 *
26 * Returns a new action on success, NULL on failure. This action must be
27 * destroyed using lttng_action_destroy().
28 */
29extern struct lttng_action *lttng_action_snapshot_session_create(void);
30
31/*
32 * Set the session name of an lttng_action object of type
33 * LTTNG_ACTION_TYPE_SNAPSHOT_SESSION.
34 */
35extern enum lttng_action_status lttng_action_snapshot_session_set_session_name(
36 struct lttng_action *action, const char *session_name);
37
38/*
39 * Get the session name of an lttng_action object of type
40 * LTTNG_ACTION_TYPE_SNAPSHOT_SESSION.
41 */
42extern enum lttng_action_status lttng_action_snapshot_session_get_session_name(
43 const struct lttng_action *action, const char **session_name);
44
45/*
46 * Set an explicit snapshot output for this snapshot session action.
47 *
48 * The given snapshot output will be used instead of the session's
49 * default snapshot output.
50 *
51 * This function takes ownership of the given snapshot output.
52 */
53extern enum lttng_action_status lttng_action_snapshot_session_set_output(
54 struct lttng_action *action,
55 struct lttng_snapshot_output *output);
56
57/*
58 * Get the explicit snapshot output for this snapshot session action.
59 */
60extern enum lttng_action_status lttng_action_snapshot_session_get_output(
61 const struct lttng_action *action,
62 const struct lttng_snapshot_output **output);
63
d35c7a38 64/*
7f4d5b07 65 * Set the rate policy of a snapshot session action.
d35c7a38
JR
66 *
67 * Returns LTTNG_ACTION_STATUS_OK on success,
68 * LTTNG_ACTION_STATUS_ERROR on internal error,
69 * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
70 */
7f4d5b07 71extern enum lttng_action_status lttng_action_snapshot_session_set_rate_policy(
d35c7a38 72 struct lttng_action *action,
7f4d5b07 73 const struct lttng_rate_policy *policy);
d35c7a38
JR
74
75/*
7f4d5b07 76 * Get the rate policy of a snapshot session action.
d35c7a38
JR
77 *
78 * Returns LTTNG_ACTION_STATUS_OK on success,
79 * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
80 */
7f4d5b07 81extern enum lttng_action_status lttng_action_snapshot_session_get_rate_policy(
d35c7a38 82 const struct lttng_action *action,
7f4d5b07 83 const struct lttng_rate_policy **policy);
d35c7a38 84
757c48a2
SM
85#ifdef __cplusplus
86}
87#endif
88
89#endif /* LTTNG_ACTION_SNAPSHOT_SESSION_H */
This page took 0.027872 seconds and 4 git commands to generate.