Implement firing policy for stop session action
[lttng-tools.git] / include / lttng / action / stop-session.h
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_STOP_SESSION_H
9 #define LTTNG_ACTION_STOP_SESSION_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 stop-session action object.
20 *
21 * A stop session action object must have a session name set to be considered
22 * valid when used with a trigger object (lttng_trigger). A name can be set
23 * using `lttng_action_stop_session_set_session_name`.
24 *
25 * Returns a new action on success, NULL on failure. This action must be
26 * destroyed using lttng_action_destroy().
27 */
28 extern struct lttng_action *lttng_action_stop_session_create(void);
29
30 /*
31 * Set the session name of an lttng_action object of type
32 * LTTNG_ACTION_TYPE_STOP_SESSION.
33 */
34 extern enum lttng_action_status lttng_action_stop_session_set_session_name(
35 struct lttng_action *action, const char *session_name);
36
37 /*
38 * Get the session name of an lttng_action object of type
39 * LTTNG_ACTION_TYPE_STOP_SESSION.
40 */
41 extern enum lttng_action_status lttng_action_stop_session_get_session_name(
42 const struct lttng_action *action, const char **session_name);
43
44 /*
45 * Set the firing policy of a stop session action.
46 *
47 * Returns LTTNG_ACTION_STATUS_OK on success,
48 * LTTNG_ACTION_STATUS_ERROR on internal error,
49 * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
50 */
51 extern enum lttng_action_status lttng_action_stop_session_set_firing_policy(
52 struct lttng_action *action,
53 const struct lttng_firing_policy *policy);
54
55 /*
56 * Get the firing policy of a stop session action.
57 *
58 * Returns LTTNG_ACTION_STATUS_OK on success,
59 * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed.
60 */
61 extern enum lttng_action_status lttng_action_stop_session_get_firing_policy(
62 const struct lttng_action *action,
63 const struct lttng_firing_policy **policy);
64
65 #ifdef __cplusplus
66 }
67 #endif
68
69 #endif /* LTTNG_ACTION_STOP_SESSION_H */
This page took 0.029636 seconds and 4 git commands to generate.