LTTng control library C API
Loading...
Searching...
No Matches
Trigger action API
Collaboration diagram for Trigger action API:

Modules

 Trigger action rate policy API
 
 Trigger action list API
 
 â€śNotify” trigger action API
 
 â€śStart recording session” trigger action API
 
 â€śStop recording session” trigger action API
 
 â€śRotate recording session snapshot” trigger action API
 
 â€śTake recording session snapshot” trigger action API
 
 â€śIncrement map value” trigger action API
 

Enumerations

enum  lttng_action_status { LTTNG_ACTION_STATUS_OK , LTTNG_ACTION_STATUS_ERROR , LTTNG_ACTION_STATUS_UNKNOWN , LTTNG_ACTION_STATUS_INVALID , LTTNG_ACTION_STATUS_UNSET }
 Return type of trigger action API functions. More...
 
enum  lttng_action_type {
  LTTNG_ACTION_TYPE_NOTIFY , LTTNG_ACTION_TYPE_START_SESSION , LTTNG_ACTION_TYPE_STOP_SESSION , LTTNG_ACTION_TYPE_ROTATE_SESSION ,
  LTTNG_ACTION_TYPE_SNAPSHOT_SESSION , LTTNG_ACTION_TYPE_LIST , LTTNG_ACTION_TYPE_INCREMENT_MAP_VALUE , LTTNG_ACTION_TYPE_UNKNOWN
}
 Trigger action type. More...
 

Functions

void lttng_action_destroy (struct lttng_action *action)
 Destroys the trigger action action.
 
enum lttng_action_type lttng_action_get_type (const struct lttng_action *action)
 Returns the type of the trigger action action.
 

Detailed Description

A trigger action is the part of a trigger which LTTng executes when its trigger condition is satisfied.

As of LTTng-tools 16.2, the following trigger actions are available:

Action type Type enumerator Creation function
Notify LTTNG_ACTION_TYPE_NOTIFY lttng_action_notify_create()
Start recording session LTTNG_ACTION_TYPE_START_SESSION lttng_action_start_session_create()
Stop recording session LTTNG_ACTION_TYPE_STOP_SESSION lttng_action_stop_session_create()
Rotate recording session snapshot LTTNG_ACTION_TYPE_ROTATE_SESSION lttng_action_rotate_session_create()
Take recording session snapshot LTTNG_ACTION_TYPE_SNAPSHOT_SESSION lttng_action_snapshot_session_create()
Increment map value LTTNG_ACTION_TYPE_INCREMENT_MAP_VALUE lttng_action_increment_map_value_create()

LTTng can execute more than one action when a trigger fires: create a trigger action list with lttng_action_list_create().

Get the type of a trigger condition with lttng_condition_get_type().

By default, LTTng executes the action of a trigger every time it fires. See Trigger action rate policy API to change the rate policy of a trigger action (every N times or once after N times). As of LTTng-tools 16.2, you cannot change the rate policy of an “increment map value” action: its effective rate policy is “every time”.

Destroy a trigger condition with lttng_condition_destroy().

Enumeration Type Documentation

◆ lttng_action_status

Return type of trigger action API functions.

Enumerator
LTTNG_ACTION_STATUS_OK 

Success.

LTTNG_ACTION_STATUS_ERROR 

Error.

LTTNG_ACTION_STATUS_INVALID 

Unsatisfied precondition.

LTTNG_ACTION_STATUS_UNSET 

Not set.

◆ lttng_action_type

Trigger action type.

Get the type of a trigger action with lttng_action_get_type().

Enumerator
LTTNG_ACTION_TYPE_NOTIFY 

Notify.

LTTNG_ACTION_TYPE_START_SESSION 

Start recording session.

LTTNG_ACTION_TYPE_STOP_SESSION 

Stop recording session.

LTTNG_ACTION_TYPE_ROTATE_SESSION 

Rotate recording session snapshot.

LTTNG_ACTION_TYPE_SNAPSHOT_SESSION 

Take recording session snapshot.

LTTNG_ACTION_TYPE_LIST 

Trigger action list.

LTTNG_ACTION_TYPE_INCREMENT_MAP_VALUE 

Increment map value.

LTTNG_ACTION_TYPE_UNKNOWN 

Unknown (error).

Function Documentation

◆ lttng_action_destroy()

void lttng_action_destroy ( struct lttng_action *  action)
extern

Destroys the trigger action action.

Parameters
[in]action

Trigger action to destroy.

May be NULL.

◆ lttng_action_get_type()

enum lttng_action_type lttng_action_get_type ( const struct lttng_action *  action)
extern

Returns the type of the trigger action action.

Parameters
[in]actionTrigger action of which to get the type.
Returns
Type of action.
Precondition
  • action is not NULL.