![]() |
LTTng control library C API
|

Data Structures | |
| struct | lttng_clear_handle |
| Recording session clearing handle (opaque type). More... | |
Enumerations | |
| enum | lttng_clear_handle_status { LTTNG_CLEAR_HANDLE_STATUS_OK , LTTNG_CLEAR_HANDLE_STATUS_COMPLETED , LTTNG_CLEAR_HANDLE_STATUS_TIMEOUT , LTTNG_CLEAR_HANDLE_STATUS_INVALID , LTTNG_CLEAR_HANDLE_STATUS_ERROR } |
| Return type of recording session clearing handle functions. More... | |
Functions | |
| void | lttng_clear_handle_destroy (struct lttng_clear_handle *handle) |
Destroys the recording session clearing handle handle. | |
| enum lttng_clear_handle_status | lttng_clear_handle_get_result (const struct lttng_clear_handle *handle, enum lttng_error_code *result) |
Sets *result to the result of the recording session clearing operation identified by handle. | |
| enum lttng_clear_handle_status | lttng_clear_handle_wait_for_completion (struct lttng_clear_handle *handle, int timeout_ms) |
Waits for the recording session clearing operation identified by handle to complete. | |
| enum lttng_error_code | lttng_clear_session (const char *session_name, struct lttng_clear_handle **handle) |
Initiates a clearing operation of the recording session named session_name. | |
This API makes it possible to clear a recording session, that is, to delete the contents of its tracing buffers and/or of all its local and streamed trace data.
To clear a recording session:
Call lttng_clear_session(), passing the name of the recording session to clear.
This function initiates a clearing operation, returning immediately.
This function can set a pointer to a clearing handle so that you can wait for the completion of the operation. Without such a handle, you can't know when the clearing operation completes and whether or not it does successfully.
lttng-clear(1) Return type of recording session clearing handle functions.
Error status enumerators have a negative value.
|
extern |
Destroys the recording session clearing handle handle.
| [in] | handle | Recording session clearing handle to destroy. May be |
|
extern |
Sets *result to the result of the recording session clearing operation identified by handle.
You must successfully wait for the completion of the recording session clearing operation identified by handle with lttng_clear_handle_wait_for_completion() before you call this function.
On success, *result is LTTNG_OK if the clearing operation was successful.
| [in] | handle | Handle of the recording session clearing operation of which to get the result. |
| [out] | result | On success, this function sets
|
| LTTNG_CLEAR_HANDLE_STATUS_OK | Success: *result is the result of the recording session clearing operation identified by handle. |
| LTTNG_CLEAR_HANDLE_STATUS_INVALID | Unsatisfied precondition. |
| LTTNG_CLEAR_HANDLE_STATUS_ERROR | Other error. |
handle is not NULL.handle with lttng_clear_handle_wait_for_completion().result is not NULL.
|
extern |
Waits for the recording session clearing operation identified by handle to complete.
If this function returns LTTNG_CLEAR_HANDLE_STATUS_COMPLETED, then the recording session clearing operation identified by handle completed. This doesn't mean, however, that the clearing operation itself succeeded; use lttng_clear_handle_get_result() to know this.
| [in] | handle | Recording session clearing handle which identifies the clearing operation of which to wait for completion. |
| [in] | timeout_ms | Maximum time (milliseconds) to wait for the completion of the recording session clearing operation identified by handle before returning LTTNG_CLEAR_HANDLE_STATUS_TIMEOUT, or -1 to wait indefinitely. |
| LTTNG_CLEAR_HANDLE_STATUS_COMPLETED | The recording session clearing operation identified by handle completed (with or without success). |
| LTTNG_CLEAR_HANDLE_STATUS_INVALID | Unsatisfied precondition. |
| LTTNG_CLEAR_HANDLE_STATUS_TIMEOUT | The function waited for the completion of the recording session clearing operation for more than timeout_ms ms. |
| LTTNG_CLEAR_HANDLE_STATUS_ERROR | Other error. |
handle is not NULL.
|
extern |
Initiates a clearing operation of the recording session named session_name.
Depending on the mode of the recording session RS named session_name, the clearing operation attempts to:
Delete the contents of the recording buffers of RS.
Delete the local/remote data stream files of RS.
Delete the contents of the recording buffers of RS.
LTTng doesn't touch prior snapshots of RS.
Delete the contents of the recording buffers of RS.
Delete the remote data stream files of RS.
Any active live reader currently reading a data stream packet may continue to read said packet completely.
The clearing operation which this function initiates, if successful, guarantees that any trace data which LTTng produced before you call this function won't be part of any trace, except:
It's possible that trace data which LTTng produces while you're calling this function makes it to a trace.
Use *handle to wait for the completion of the recording session clearing operation.
| [in] | session_name | Name of the recording session to clear. |
| [out] | handle | On success, this function sets May be Wait for the completion of this clearing operation with lttng_clear_handle_wait_for_completion(). Destroy |
LTTNG_OK on success, or another enumerator otherwise.
Notable return values:
| LTTNG_ERR_CLEAR_RELAY_DISALLOWED | The relay daemon doesn't allow recording session clearing operations. |
| LTTNG_ERR_CLEAR_NOT_AVAILABLE_RELAY | The relay daemon doesn't support the recording session clearing operation. |
| LTTNG_ERR_CLEAR_FAIL_CONSUMER | A consumer daemon failed to clear the recording session named session_name. |
session_name is not NULL.session_name names an accessible recording session within the connected session daemon.session_name.