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 | ||
11 | #ifdef __cplusplus | |
12 | extern "C" { | |
13 | #endif | |
14 | ||
15 | struct lttng_action; | |
16 | struct lttng_snapshot_output; | |
17 | ||
18 | /* | |
19 | * Create a newly allocated snapshot-session action object. | |
20 | * | |
21 | * A snapshot session action object must have a session name set to be | |
22 | * considered valid when used with a trigger object (lttng_trigger). A name can | |
23 | * be set using `lttng_action_snapshot_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_snapshot_session_create(void); | |
29 | ||
30 | /* | |
31 | * Set the session name of an lttng_action object of type | |
32 | * LTTNG_ACTION_TYPE_SNAPSHOT_SESSION. | |
33 | */ | |
34 | extern enum lttng_action_status lttng_action_snapshot_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_SNAPSHOT_SESSION. | |
40 | */ | |
41 | extern enum lttng_action_status lttng_action_snapshot_session_get_session_name( | |
42 | const struct lttng_action *action, const char **session_name); | |
43 | ||
44 | /* | |
45 | * Set an explicit snapshot output for this snapshot session action. | |
46 | * | |
47 | * The given snapshot output will be used instead of the session's | |
48 | * default snapshot output. | |
49 | * | |
50 | * This function takes ownership of the given snapshot output. | |
51 | */ | |
52 | extern enum lttng_action_status lttng_action_snapshot_session_set_output( | |
53 | struct lttng_action *action, | |
54 | struct lttng_snapshot_output *output); | |
55 | ||
56 | /* | |
57 | * Get the explicit snapshot output for this snapshot session action. | |
58 | */ | |
59 | extern enum lttng_action_status lttng_action_snapshot_session_get_output( | |
60 | const struct lttng_action *action, | |
61 | const struct lttng_snapshot_output **output); | |
62 | ||
63 | #ifdef __cplusplus | |
64 | } | |
65 | #endif | |
66 | ||
67 | #endif /* LTTNG_ACTION_SNAPSHOT_SESSION_H */ |