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

Data Structures | |
| struct | lttng_rate_policy |
| Trigger action rate policy (opaque type). More... | |
Enumerations | |
| enum | lttng_rate_policy_status { LTTNG_RATE_POLICY_STATUS_OK , LTTNG_RATE_POLICY_STATUS_INVALID , LTTNG_RATE_POLICY_STATUS_ERROR , LTTNG_RATE_POLICY_STATUS_UNKNOWN , LTTNG_RATE_POLICY_STATUS_UNSET , LTTNG_RATE_POLICY_STATUS_UNSUPPORTED , LTTNG_RATE_POLICY_STATUS_PERMISSION_DENIED } |
| Return type of trigger action rate policy API functions. More... | |
| enum | lttng_rate_policy_type { LTTNG_RATE_POLICY_TYPE_EVERY_N , LTTNG_RATE_POLICY_TYPE_ONCE_AFTER_N , LTTNG_RATE_POLICY_TYPE_UNKNOWN } |
| Trigger action rate policy type. More... | |
Functions | |
| void | lttng_rate_policy_destroy (struct lttng_rate_policy *policy) |
Destroys the trigger action rate policy policy. | |
| struct lttng_rate_policy * | lttng_rate_policy_every_n_create (uint64_t n) |
Creates an “every N times” trigger action rate policy, setting N to n. | |
| enum lttng_rate_policy_status | lttng_rate_policy_every_n_get_interval (const struct lttng_rate_policy *policy, uint64_t *n) |
Sets *n to N of the “every N times” trigger action rate policy policy. | |
| enum lttng_rate_policy_type | lttng_rate_policy_get_type (const struct lttng_rate_policy *policy) |
Returns the type of the trigger action rate policy policy. | |
| struct lttng_rate_policy * | lttng_rate_policy_once_after_n_create (uint64_t n) |
Creates a “once after N times” trigger action rate policy, setting N to n. | |
| enum lttng_rate_policy_status | lttng_rate_policy_once_after_n_get_threshold (const struct lttng_rate_policy *policy, uint64_t *n) |
Sets *n to N of the “once after N times” trigger action rate policy policy. | |
A trigger which fires (its condition is satisfied) leads to an execution request for its action. If its action is an action list, then LTTng creates an execution request for each action of the list, in order.
An execution request of a given action A first increments the execution request count C of A. The rate policy of A dictates how frequently A is allowed to execute relative to C.
In other words, the rate policy of a trigger action determines whether and when an execution request becomes an actual execution.
As of LTTng-tools 14.2, the available trigger action rate policies are:
| Rate policy | Description | Type enumerator | Creation function |
|---|---|---|---|
| “Every N times” | LTTng executes A every time C is a multiple of N. | LTTNG_RATE_POLICY_TYPE_EVERY_N | lttng_rate_policy_every_n_create() |
| “Once after N times” | LTTng executes A a single time, when C is greater than or equal to N. | LTTNG_RATE_POLICY_TYPE_ONCE_AFTER_N | lttng_rate_policy_once_after_n_create() |
Get the type of a trigger action rate policy with lttng_rate_policy_get_type().
Destroy a trigger action rate policy with lttng_rate_policy_destroy().
Set the rate policy of a trigger action with the following functions, depending on the action type:
Trigger action rate policy type.
Get the type of a trigger action rate policy with lttng_rate_policy_get_type().
| Enumerator | |
|---|---|
| LTTNG_RATE_POLICY_TYPE_EVERY_N | Every N times. |
| LTTNG_RATE_POLICY_TYPE_ONCE_AFTER_N | Once after N times. |
| LTTNG_RATE_POLICY_TYPE_UNKNOWN | Unknown (error). |
|
extern |
Destroys the trigger action rate policy policy.
| [in] | policy | Trigger action rate policy to destroy. May be |
|
extern |
Creates an “every N times” trigger action rate policy, setting N to n.
| [in] | n | Value of N. |
Trigger action rate policy with the type LTTNG_RATE_POLICY_TYPE_EVERY_N on success, or NULL on error.
Destroy the returned rate policy with lttng_rate_policy_destroy().
|
extern |
Sets *n to N of the “every N times” trigger action rate policy policy.
| [in] | policy | “Every N times” trigger action rate policy of which to get N. |
| [out] | n | On success, this function sets *n to N. |
| LTTNG_RATE_POLICY_STATUS_OK | Success. |
| LTTNG_RATE_POLICY_STATUS_INVALID | Unsatisfied precondition. |
policy is not NULL.policy has the type LTTNG_RATE_POLICY_TYPE_EVERY_N.n is not NULL.
|
extern |
Returns the type of the trigger action rate policy policy.
| [in] | policy | Trigger action rate policy of which to get the type. |
policy.policy is not NULL.
|
extern |
Creates a “once after N times” trigger action rate policy, setting N to n.
| [in] | n | Value of N. |
Trigger action rate policy with the type LTTNG_RATE_POLICY_TYPE_ONCE_AFTER_N on success, or NULL on error.
Destroy the returned rate policy with lttng_rate_policy_destroy().
|
extern |
Sets *n to N of the “once after N times” trigger action rate policy policy.
| [in] | policy | “Once after N times” trigger action rate policy of which to get N. |
| [out] | n | On success, this function sets *n to N. |
| LTTNG_RATE_POLICY_STATUS_OK | Success. |
| LTTNG_RATE_POLICY_STATUS_INVALID | Unsatisfied precondition. |
policy is not NULL.policy has the type LTTNG_RATE_POLICY_TYPE_ONCE_AFTER_N.n is not NULL.