LTTng control library C API
Loading...
Searching...
No Matches
“Take recording session snapshot” trigger action API
Collaboration diagram for “Take recording session snapshot” trigger action API:

Functions

struct lttng_action * lttng_action_snapshot_session_create (void)
 Creates an initial “take recording session snapshot” trigger action.
 
enum lttng_action_status lttng_action_snapshot_session_get_output (const struct lttng_action *action, const struct lttng_snapshot_output **output)
 Sets *output to the recording session snapshot output of the “take recording session snapshot” trigger action action.
 
enum lttng_action_status lttng_action_snapshot_session_get_rate_policy (const struct lttng_action *action, const struct lttng_rate_policy **policy)
 Sets *policy to the rate policy of the “take recording session snapshot” trigger action action.
 
enum lttng_action_status lttng_action_snapshot_session_get_session_name (const struct lttng_action *action, const char **session_name)
 Sets *session_name to the target recording session name of the “take recording session snapshot” trigger action action.
 
enum lttng_action_status lttng_action_snapshot_session_set_output (struct lttng_action *action, struct lttng_snapshot_output *output)
 Sets the recording session snapshot output of the “take recording session snapshot” trigger action action to output.
 
enum lttng_action_status lttng_action_snapshot_session_set_rate_policy (struct lttng_action *action, const struct lttng_rate_policy *policy)
 Sets the rate policy of the “take recording session snapshot” trigger action action to policy.
 
enum lttng_action_status lttng_action_snapshot_session_set_session_name (struct lttng_action *action, const char *session_name)
 Sets the target recording session name (of which to take a snapshot) of the “take recording session snapshot” trigger action action to session_name.
 

Detailed Description

A “take recording session snapshot” trigger action takes a snapshot of a specific recording session when its containing trigger fires.

LTTng finds the recording session of which to take a snapshot by name when it executes the action.

Executing this action is equivalent to calling lttng_snapshot_record() with the same recording session name.

A “start recording session” trigger action has the type LTTNG_ACTION_TYPE_SNAPSHOT_SESSION.

To create a valid “take recording session snapshot” trigger action:

  1. Create the initial trigger action with lttng_action_snapshot_session_create().
  2. Set the target recording session name with lttng_action_snapshot_session_set_session_name().

The initial recording snapshot output of a “take recording session snapshot” trigger action is the default snapshot output of the target recording session. Override the snapshot output of the action with lttng_action_snapshot_session_set_output().

Get the target recording session name of a “take recording session snapshot” trigger action with lttng_action_snapshot_session_get_session_name().

Set and get the rate policy of a “take recording session snapshot” trigger action with lttng_action_snapshot_session_set_rate_policy() and lttng_action_snapshot_session_get_rate_policy().

Function Documentation

◆ lttng_action_snapshot_session_create()

struct lttng_action * lttng_action_snapshot_session_create ( void  )
extern

Creates an initial “take recording session snapshot” trigger action.

On success, the returned trigger action isn't valid yet; you must set a target recording session name with lttng_action_snapshot_session_set_session_name().

The initial recording session snapshot output of the returned trigger action is the default snapshot output of the target recording session. Set a new snapshot output with lttng_action_snapshot_session_set_output().

The initial rate policy of the returned trigger action is “every time”. Set a new rate policy with lttng_action_snapshot_session_set_rate_policy().

Returns

Trigger action with the type LTTNG_ACTION_TYPE_SNAPSHOT_SESSION on success, or NULL on error.

Destroy the returned trigger action with lttng_action_destroy().

◆ lttng_action_snapshot_session_get_output()

enum lttng_action_status lttng_action_snapshot_session_get_output ( const struct lttng_action *  action,
const struct lttng_snapshot_output **  output 
)
extern

Sets *output to the recording session snapshot output of the “take recording session snapshot” trigger action action.

Parameters
[in]action“Take recording session snapshot” trigger action of which to get the recording session snapshot output.
[out]output

On success, this function sets *output to the recording session snapshot output of action.

action owns *output.

*output remains valid until the next function call with action.

Return values
LTTNG_ACTION_STATUS_OKSuccess.
LTTNG_ACTION_STATUS_INVALIDUnsatisfied precondition.
Precondition
See also
lttng_action_snapshot_session_set_output() – Set the recording session snapshot output of a “take recording session snapshot” trigger action.

◆ lttng_action_snapshot_session_get_rate_policy()

enum lttng_action_status lttng_action_snapshot_session_get_rate_policy ( const struct lttng_action *  action,
const struct lttng_rate_policy **  policy 
)
extern

Sets *policy to the rate policy of the “take recording session snapshot” trigger action action.

Parameters
[in]action“Take recording session snapshot” trigger action of which to get the rate policy.
[out]policy

On success, this function sets *policy to the rate policy of action.

action owns *policy.

*policy remains valid until the next function call with action.

Return values
LTTNG_ACTION_STATUS_OKSuccess.
LTTNG_ACTION_STATUS_INVALIDUnsatisfied precondition.
Precondition
See also
lttng_action_snapshot_session_set_rate_policy() – Set the rate policy of a “take recording session snapshot” trigger action.

◆ lttng_action_snapshot_session_get_session_name()

enum lttng_action_status lttng_action_snapshot_session_get_session_name ( const struct lttng_action *  action,
const char **  session_name 
)
extern

Sets *session_name to the target recording session name of the “take recording session snapshot” trigger action action.

Parameters
[in]action“Take recording session snapshot” trigger action of which to get the target recording session name.
[out]session_name

On success, this function sets *session_name to the target recording session name of action.

action owns *session_name.

*session_name remains valid until the next function call with action.

Return values
LTTNG_ACTION_STATUS_OKSuccess.
LTTNG_ACTION_STATUS_INVALIDUnsatisfied precondition.
Precondition
See also
lttng_action_snapshot_session_set_session_name() – Set the target recording session name of a “take recording session snapshot” trigger action.

◆ lttng_action_snapshot_session_set_output()

enum lttng_action_status lttng_action_snapshot_session_set_output ( struct lttng_action *  action,
struct lttng_snapshot_output *  output 
)
extern

Sets the recording session snapshot output of the “take recording session snapshot” trigger action action to output.

Parameters
[in]action“Take recording session snapshot” trigger action of which to set the snapshot output.
[in]outputRecording session snapshot output of action (moved).
Return values
LTTNG_ACTION_STATUS_OKSuccess.
LTTNG_ACTION_STATUS_INVALIDUnsatisfied precondition.
LTTNG_ACTION_STATUS_ERRORMemory error.
Precondition
See also
lttng_action_snapshot_session_get_output() – Get the recording session snapshot output of a “take recording session snapshot” trigger action.

◆ lttng_action_snapshot_session_set_rate_policy()

enum lttng_action_status lttng_action_snapshot_session_set_rate_policy ( struct lttng_action *  action,
const struct lttng_rate_policy policy 
)
extern

Sets the rate policy of the “take recording session snapshot” trigger action action to policy.

Parameters
[in]action“Take recording session snapshot” trigger action of which to set the rate policy.
[in]policyRate policy of action (copied).
Return values
LTTNG_ACTION_STATUS_OKSuccess.
LTTNG_ACTION_STATUS_INVALIDUnsatisfied precondition.
LTTNG_ACTION_STATUS_ERRORMemory error.
Precondition
See also
lttng_action_snapshot_session_get_rate_policy() – Get the rate policy of a “take recording session snapshot” trigger action.

◆ lttng_action_snapshot_session_set_session_name()

enum lttng_action_status lttng_action_snapshot_session_set_session_name ( struct lttng_action *  action,
const char *  session_name 
)
extern

Sets the target recording session name (of which to take a snapshot) of the “take recording session snapshot” trigger action action to session_name.

Parameters
[in]action“Take recording session snapshot” trigger action of which to set the target recording session name.
[in]session_nameTarget recording session name of action (copied).
Return values
LTTNG_ACTION_STATUS_OKSuccess.
LTTNG_ACTION_STATUS_INVALIDUnsatisfied precondition.
LTTNG_ACTION_STATUS_ERRORMemory error.
Precondition
See also
lttng_action_snapshot_session_get_session_name() – Get the target recording session name of a “take recording session snapshot” trigger action.