2 * Copyright (C) 2019 Jérémie Galarneau <jeremie.galarneau@efficios.com>
3 * Copyright (C) 2019 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * SPDX-License-Identifier: LGPL-2.1-only
12 #include <lttng/lttng-error.h>
13 #include <lttng/lttng-export.h>
20 @addtogroup api_session_clear
24 struct lttng_clear_handle
;
28 Initiates a clearing operation of the \lt_obj_session
29 named \lt_p{session_name}.
31 Depending on the mode of the recording session \lt_var{RS}
32 named \lt_p{session_name}, the clearing operation attempts to:
35 <dt>\ref api-session-local-mode "Local"
36 <dt>\ref api-session-net-mode "Network streaming"
38 Delete the contents of the recording buffers of \lt_var{RS}.
40 Delete the local/remote data stream files of \lt_var{RS}.
42 <dt>\ref api-session-snapshot-mode "Snapshot"
44 Delete the contents of the recording buffers of \lt_var{RS}.
46 LTTng doesn't touch prior snapshots of \lt_var{RS}.
48 <dt>\ref api-session-live-mode "Live"
50 Delete the contents of the recording buffers of \lt_var{RS}.
52 Delete the remote data stream files of \lt_var{RS}.
54 Any active live reader currently reading a data stream packet
55 may continue to read said packet completely.
58 The clearing operation which this function initiates, if successful,
59 guarantees that any trace data which LTTng produced \em before you call
60 this function won't be part of any trace, except:
62 - Preexisting recording session
63 \ref api_session_snapshot "snapshots".
65 \ref api_session_rotation "trace chunk archives".
67 It's possible that trace data which LTTng produces while you're calling
68 this function makes it to a trace.
70 Use \lt_p{*handle} to wait for the completion of the recording session
73 @param[in] session_name
74 Name of the recording session to clear.
77 <strong>On success</strong>, this function sets \lt_p{*handle} to
78 a handle which identifies this recording session clearing operation.
82 Wait for the completion of this clearing operation with
83 lttng_clear_handle_wait_for_completion().
85 Destroy \lt_p{*handle} with lttng_clear_handle_destroy().
90 #LTTNG_OK on success, or a \em negative enumerator otherwise.
92 Notable return values:
96 <td>-#LTTNG_ERR_CLEAR_RELAY_DISALLOWED
98 The relay daemon doesn't allow recording session clearing
101 <td>-#LTTNG_ERR_CLEAR_NOT_AVAILABLE_RELAY
103 The relay daemon doesn't support the recording session
106 <td>-#LTTNG_ERR_CLEAR_FAIL_CONSUMER
108 A consumer daemon failed to clear the recording session named
114 @lt_pre_not_null{session_name}
115 @lt_pre_sess_exists{session_name}
117 No clearing operation is in progress for the recording session named
120 LTTNG_EXPORT
extern enum lttng_error_code
lttng_clear_session(const char *session_name
,
121 struct lttng_clear_handle
**handle
);
129 #endif /* LTTNG_CLEAR_H */
This page took 0.031051 seconds and 4 git commands to generate.