Commit | Line | Data |
---|---|---|
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 | ||
4bd69c5f SM |
11 | #include <lttng/lttng-export.h> |
12 | ||
757c48a2 SM |
13 | #ifdef __cplusplus |
14 | extern "C" { | |
15 | #endif | |
16 | ||
17 | struct lttng_action; | |
18 | struct lttng_snapshot_output; | |
7f4d5b07 | 19 | struct lttng_rate_policy; |
757c48a2 SM |
20 | |
21 | /* | |
22 | * Create a newly allocated snapshot-session action object. | |
23 | * | |
24 | * A snapshot session action object must have a session name set to be | |
25 | * considered valid when used with a trigger object (lttng_trigger). A name can | |
26 | * be set using `lttng_action_snapshot_session_set_session_name`. | |
27 | * | |
28 | * Returns a new action on success, NULL on failure. This action must be | |
29 | * destroyed using lttng_action_destroy(). | |
30 | */ | |
4bd69c5f | 31 | LTTNG_EXPORT extern struct lttng_action *lttng_action_snapshot_session_create(void); |
757c48a2 SM |
32 | |
33 | /* | |
34 | * Set the session name of an lttng_action object of type | |
35 | * LTTNG_ACTION_TYPE_SNAPSHOT_SESSION. | |
36 | */ | |
4bd69c5f | 37 | LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_set_session_name( |
757c48a2 SM |
38 | struct lttng_action *action, const char *session_name); |
39 | ||
40 | /* | |
41 | * Get the session name of an lttng_action object of type | |
42 | * LTTNG_ACTION_TYPE_SNAPSHOT_SESSION. | |
43 | */ | |
4bd69c5f | 44 | LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_get_session_name( |
757c48a2 SM |
45 | const struct lttng_action *action, const char **session_name); |
46 | ||
47 | /* | |
48 | * Set an explicit snapshot output for this snapshot session action. | |
49 | * | |
50 | * The given snapshot output will be used instead of the session's | |
51 | * default snapshot output. | |
52 | * | |
53 | * This function takes ownership of the given snapshot output. | |
54 | */ | |
4bd69c5f | 55 | LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_set_output( |
757c48a2 SM |
56 | struct lttng_action *action, |
57 | struct lttng_snapshot_output *output); | |
58 | ||
59 | /* | |
60 | * Get the explicit snapshot output for this snapshot session action. | |
61 | */ | |
4bd69c5f | 62 | LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_get_output( |
757c48a2 SM |
63 | const struct lttng_action *action, |
64 | const struct lttng_snapshot_output **output); | |
65 | ||
d35c7a38 | 66 | /* |
7f4d5b07 | 67 | * Set the rate policy of a snapshot session action. |
d35c7a38 JR |
68 | * |
69 | * Returns LTTNG_ACTION_STATUS_OK on success, | |
70 | * LTTNG_ACTION_STATUS_ERROR on internal error, | |
71 | * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed. | |
72 | */ | |
4bd69c5f | 73 | LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_set_rate_policy( |
d35c7a38 | 74 | struct lttng_action *action, |
7f4d5b07 | 75 | const struct lttng_rate_policy *policy); |
d35c7a38 JR |
76 | |
77 | /* | |
7f4d5b07 | 78 | * Get the rate policy of a snapshot session action. |
d35c7a38 JR |
79 | * |
80 | * Returns LTTNG_ACTION_STATUS_OK on success, | |
81 | * LTTNG_ACTION_STATUS_INVALID if invalid parameters are passed. | |
82 | */ | |
4bd69c5f | 83 | LTTNG_EXPORT extern enum lttng_action_status lttng_action_snapshot_session_get_rate_policy( |
d35c7a38 | 84 | const struct lttng_action *action, |
7f4d5b07 | 85 | const struct lttng_rate_policy **policy); |
d35c7a38 | 86 | |
757c48a2 SM |
87 | #ifdef __cplusplus |
88 | } | |
89 | #endif | |
90 | ||
91 | #endif /* LTTNG_ACTION_SNAPSHOT_SESSION_H */ |