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

Data Structures | |
| struct | lttng_session_descriptor |
| Recording session descriptor (opaque type). More... | |
Enumerations | |
| enum | lttng_session_descriptor_status { LTTNG_SESSION_DESCRIPTOR_STATUS_OK , LTTNG_SESSION_DESCRIPTOR_STATUS_INVALID , LTTNG_SESSION_DESCRIPTOR_STATUS_UNSET } |
| Return type of recording session descriptor fuctions. More... | |
Functions | |
| struct lttng_session_descriptor * | lttng_session_descriptor_create (const char *session_name) |
Creates a recording session descriptor to create a no-output, local recording session named session_name. | |
| void | lttng_session_descriptor_destroy (struct lttng_session_descriptor *session_descriptor) |
Destroys the recording session descriptor session_descriptor. | |
| enum lttng_session_descriptor_status | lttng_session_descriptor_get_session_name (const struct lttng_session_descriptor *session_descriptor, const char **session_name) |
Sets *session_name to the name of the recording session which lttng_create_session_ext() created from the recording session descriptor session_descriptor. | |
| struct lttng_session_descriptor * | lttng_session_descriptor_live_network_create (const char *session_name, const char *control_url, const char *data_url, unsigned long long live_timer_period) |
Creates a recording session descriptor to create a live recording session named session_name. | |
| struct lttng_session_descriptor * | lttng_session_descriptor_local_create (const char *session_name, const char *trace_dir) |
Creates a recording session descriptor to create a local recording session named session_name. | |
| struct lttng_session_descriptor * | lttng_session_descriptor_network_create (const char *session_name, const char *control_url, const char *data_url) |
Creates a recording session descriptor to create a network streaming recording session named session_name. | |
| struct lttng_session_descriptor * | lttng_session_descriptor_snapshot_create (const char *session_name) |
Creates a recording session descriptor to create a snapshot recording session named session_name without an initial output. | |
| struct lttng_session_descriptor * | lttng_session_descriptor_snapshot_local_create (const char *session_name, const char *trace_dir) |
Creates a recording session descriptor to create a snapshot recording session named session_name and having an initial local output. | |
| struct lttng_session_descriptor * | lttng_session_descriptor_snapshot_network_create (const char *session_name, const char *control_url, const char *data_url) |
Creates a recording session descriptor to create a snapshot recording session named session_name and having an initial remote output. | |
A recording session descriptor describes the properties of a recording session to be (not created yet).
To create a recording session from a recording session descriptor:
Create a recording session descriptor with one of the dedicated creation functions, depending on the recording session mode:
Call lttng_create_session_ext(), passing the recording session descriptor of step 1.
After a successful call to this function, you can call lttng_session_descriptor_get_session_name() to get the name of the created recording session (set when creating the descriptor or automatically generated).
Return type of recording session descriptor fuctions.
Error status enumerators have a negative value.
|
extern |
Creates a recording session descriptor to create a no-output, local recording session named session_name.
LTTng won't write any trace data for a recording session created from the returned descriptor.
| [in] | session_name | Recording session name. If Call lttng_session_descriptor_get_session_name() with the returned recording session descriptor after successfully calling lttng_create_session_ext() to get the generated name. |
Recording session descriptor on success, or NULL on error.
Destroy the returned descriptor with lttng_session_descriptor_destroy().
session_name is not auto.
|
extern |
Destroys the recording session descriptor session_descriptor.
This function doesn't destroy the recording session which lttng_create_session_ext() created from session_descriptor, but only the descriptor itself.
Use lttng_destroy_session_ext() to destroy a recording session.
| [in] | session_descriptor | Recording session descriptor to destroy. May be |
|
extern |
Sets *session_name to the name of the recording session which lttng_create_session_ext() created from the recording session descriptor session_descriptor.
Call this function after successfully calling lttng_create_session_ext() when session_descriptor wasn't created with a specific recording session name to get the automatically generated name of the created recording session.
| [in] | session_descriptor | Recording session descriptor from which lttng_create_session_ext() previously created the recording session of which to get the name. |
| [out] | session_name | On success, this function sets
|
| LTTNG_SESSION_DESCRIPTOR_STATUS_OK | Success. |
| LTTNG_SESSION_DESCRIPTOR_STATUS_INVALID | Unsatisfied precondition. |
| LTTNG_SESSION_DESCRIPTOR_STATUS_UNSET | The name property of session_descriptor is not set. |
session_descriptor is not NULL.session_descriptor.session_name is not NULL.
|
extern |
Creates a recording session descriptor to create a live recording session named session_name.
The valid combinations of control_url and data_url are:
control_url | data_url | Behaviour |
|---|---|---|
NULL | NULL | Use Use |
| Single-port output URL | NULL | Use the protocol, host, and trace directory (if any) of control_url and the port 5343 as data_url. |
| Single-port output URL | Single-port output URL with the exact same protocol, host, and trace directory (if any) as control_url. | Use the specified output URLs. |
| Two-port output URL | NULL | Use the protocol, host, data port, and trace directory (if any) of control_url as data_url. |
| [in] | session_name | Recording session name. If Call lttng_session_descriptor_get_session_name() with the returned recording session descriptor after successfully calling lttng_create_session_ext() to get the generated name. |
| [in] | control_url | One of:
This function copies If |
| [in] | data_url | Single-port output URL which indicates where to send the trace data (copied). May be |
| [in] | live_timer_period | Period (µs) of the live timers of all the channels of a recording session which lttng_create_session_ext() creates from the returned descriptor. |
Recording session descriptor on success, or NULL on error.
Destroy the returned descriptor with lttng_session_descriptor_destroy().
session_name is not auto.control_url and data_url satisfy one of the valid combinations shown in the table above.live_timer_period ≥ 1
|
extern |
Creates a recording session descriptor to create a local recording session named session_name.
| [in] | session_name | Recording session name. If Call lttng_session_descriptor_get_session_name() with the returned recording session descriptor after successfully calling lttng_create_session_ext() to get the generated name. |
| [in] | trace_dir | Absolute path of the directory containing the traces of the recording session you create from the returned descriptor (copied). If
|
Recording session descriptor on success, or NULL on error.
Destroy the returned descriptor with lttng_session_descriptor_destroy().
session_name is not auto.NULL, trace_dir is a valid path.
|
extern |
Creates a recording session descriptor to create a network streaming recording session named session_name.
The valid combinations of control_url and data_url are:
control_url | data_url | Behaviour |
|---|---|---|
NULL | NULL | Use Use |
| Single-port output URL | NULL | Use the protocol, host, and trace directory (if any) of control_url and the port 5343 as data_url. |
| Single-port output URL | Single-port output URL with the exact same protocol, host, and trace directory (if any) as control_url. | Use the specified output URLs. |
| Two-port output URL | NULL | Use the protocol, host, data port, and trace directory (if any) of control_url as data_url. |
| [in] | session_name | Recording session name. If Call lttng_session_descriptor_get_session_name() with the returned recording session descriptor after successfully calling lttng_create_session_ext() to get the generated name. |
| [in] | control_url | One of:
This function copies If |
| [in] | data_url | Single-port output URL which indicates where to send the trace data (copied). May be |
Recording session descriptor on success, or NULL on error.
Destroy the returned descriptor with lttng_session_descriptor_destroy().
session_name is not auto.control_url and data_url satisfy one of the valid combinations shown in the table above.
|
extern |
Creates a recording session descriptor to create a snapshot recording session named session_name without an initial output.
A recording session which lttng_create_session_ext() creates from the returned descriptor has no initial snapshot output: you need to either add one with lttng_snapshot_add_output() or provide one when you take a snapshot with lttng_snapshot_record().
| [in] | session_name | Recording session name. If Call lttng_session_descriptor_get_session_name() with the returned recording session descriptor after successfully calling lttng_create_session_ext() to get the generated name. |
Recording session descriptor on success, or NULL on error.
Destroy the returned descriptor with lttng_session_descriptor_destroy().
session_name is not auto.
|
extern |
Creates a recording session descriptor to create a snapshot recording session named session_name and having an initial local output.
Using the returned descriptor when you call lttng_create_session_ext() to create a snapshot recording session is similar to using a descriptor which lttng_session_descriptor_snapshot_create() returns and calling lttng_snapshot_add_output() after creating the recording session.
The name of this initial snapshot output is snapshot-0.
| [in] | session_name | Recording session name. If Call lttng_session_descriptor_get_session_name() with the returned recording session descriptor after successfully calling lttng_create_session_ext() to get the generated name. |
| [in] | trace_dir | Absolute path of an initial snapshot output (copied). If
|
Recording session descriptor on success, or NULL on error.
Destroy the returned descriptor with lttng_session_descriptor_destroy().
session_name is not auto.NULL, trace_dir is a valid path.
|
extern |
Creates a recording session descriptor to create a snapshot recording session named session_name and having an initial remote output.
Using the returned descriptor when you call lttng_create_session_ext() to create a snapshot recording session is similar to using a descriptor which lttng_session_descriptor_snapshot_create() returns and calling lttng_snapshot_add_output() after creating the recording session.
The name of this initial snapshot output is snapshot-0.
The valid combinations of control_url and data_url are:
control_url | data_url | Behaviour |
|---|---|---|
NULL | NULL | Use Use |
| Single-port output URL | NULL | Use the protocol, host, and trace directory (if any) of control_url and the port 5343 as data_url. |
| Single-port output URL | Single-port output URL with the exact same protocol, host, and trace directory (if any) as control_url. | Use the specified output URLs. |
| Two-port output URL | NULL | Use the protocol, host, data port, and trace directory (if any) of control_url as data_url. |
| [in] | session_name | Recording session name. If Call lttng_session_descriptor_get_session_name() with the returned recording session descriptor after successfully calling lttng_create_session_ext() to get the generated name. |
| [in] | control_url | Control data URL of an initial snapshot output. One of:
This function copies If |
| [in] | data_url | Trace data URL of an initial snapshot output (copied). Single-port output URL which indicates where to send the trace data. May be |
Recording session descriptor on success, or NULL on error.
Destroy the returned descriptor with lttng_session_descriptor_destroy().
session_name is not auto.control_url and data_url satisfy one of the valid combinations shown in the table above.