lib: compile liblttng-ctl as C++
[lttng-tools.git] / include / lttng / action / start-session.h
CommitLineData
58397d0d
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_START_SESSION_H
9#define LTTNG_ACTION_START_SESSION_H
10
4bd69c5f
SM
11#include <lttng/lttng-export.h>
12
58397d0d 13struct lttng_action;
7f4d5b07 14struct lttng_rate_policy;
58397d0d
SM
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20/*
21 * Create a newly allocated start-session action object.
22 *
23 * A start session action object must have a session name set to be considered
24 * valid when used with a trigger object (lttng_trigger). A name can be set
25 * using `lttng_action_start_session_set_session_name`.
26 *
27 * Returns a new action on success, NULL on failure. This action must be
28 * destroyed using lttng_action_destroy().
29 */
4bd69c5f 30LTTNG_EXPORT extern struct lttng_action *lttng_action_start_session_create(void);
58397d0d
SM
31
32/*
33 * Set the session name of an lttng_action object of type
34 * LTTNG_ACTION_TYPE_START_SESSION.
35 */
4bd69c5f 36LTTNG_EXPORT extern enum lttng_action_status lttng_action_start_session_set_session_name(
58397d0d
SM
37 struct lttng_action *action, const char *session_name);
38
39/*
40 * Get the session name of an lttng_action object of type
41 * LTTNG_ACTION_TYPE_START_SESSION.
42 */
4bd69c5f 43LTTNG_EXPORT extern enum lttng_action_status lttng_action_start_session_get_session_name(
58397d0d
SM
44 const struct lttng_action *action, const char **session_name);
45
1345b16b 46/*
7f4d5b07 47 * Set the rate policy of a start session action.
1345b16b
JR
48 *
49 * Returns LTTNG_ACTION_STATUS_OK on success,
50 * LTTNG_ACTION_STATUS_ERROR on internal error,
51 * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
52 */
4bd69c5f 53LTTNG_EXPORT extern enum lttng_action_status lttng_action_start_session_set_rate_policy(
1345b16b 54 struct lttng_action *action,
7f4d5b07 55 const struct lttng_rate_policy *policy);
1345b16b
JR
56
57/*
7f4d5b07 58 * Get the rate policy of a start session action.
1345b16b
JR
59 *
60 * Returns LTTNG_ACTION_STATUS_OK on success,
61 * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
62 */
4bd69c5f 63LTTNG_EXPORT extern enum lttng_action_status lttng_action_start_session_get_rate_policy(
1345b16b 64 const struct lttng_action *action,
7f4d5b07 65 const struct lttng_rate_policy **policy);
1345b16b 66
58397d0d
SM
67#ifdef __cplusplus
68}
69#endif
70
71#endif /* LTTNG_ACTION_START_SESSION_H */
This page took 0.028191 seconds and 4 git commands to generate.