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

Enumerations | |
| enum | lttng_event_field_value_status { LTTNG_EVENT_FIELD_VALUE_STATUS_OK , LTTNG_EVENT_FIELD_VALUE_STATUS_INVALID , LTTNG_EVENT_FIELD_VALUE_STATUS_UNAVAILABLE } |
| Return type of event field value API functions. More... | |
| enum | lttng_event_field_value_type { LTTNG_EVENT_FIELD_VALUE_TYPE_UNSIGNED_INT , LTTNG_EVENT_FIELD_VALUE_TYPE_SIGNED_INT , LTTNG_EVENT_FIELD_VALUE_TYPE_UNSIGNED_ENUM , LTTNG_EVENT_FIELD_VALUE_TYPE_SIGNED_ENUM , LTTNG_EVENT_FIELD_VALUE_TYPE_REAL , LTTNG_EVENT_FIELD_VALUE_TYPE_STRING , LTTNG_EVENT_FIELD_VALUE_TYPE_ARRAY , LTTNG_EVENT_FIELD_VALUE_TYPE_INVALID , LTTNG_EVENT_FIELD_VALUE_TYPE_UNKNOWN } |
| Event field value type. More... | |
Functions | |
| enum lttng_event_field_value_status | lttng_event_field_value_array_get_element_at_index (const struct lttng_event_field_value *field_val, unsigned int index, const struct lttng_event_field_value **elem_field_val) |
Sets *elem_field_val to the element of the array event field value field_val at the index index. | |
| enum lttng_event_field_value_status | lttng_event_field_value_array_get_length (const struct lttng_event_field_value *field_val, unsigned int *length) |
Sets *length to the length of the array event field value field_val. | |
| enum lttng_event_field_value_type | lttng_event_field_value_get_type (const struct lttng_event_field_value *field_val) |
Returns the type of the event field value field_val. | |
| enum lttng_event_field_value_status | lttng_event_field_value_real_get_value (const struct lttng_event_field_value *field_val, double *val) |
Sets *val to the raw value of the real number event field value field_val. | |
| enum lttng_event_field_value_status | lttng_event_field_value_signed_int_get_value (const struct lttng_event_field_value *field_val, int64_t *val) |
Sets *val to the raw value of the signed integer event field value field_val. | |
| enum lttng_event_field_value_status | lttng_event_field_value_string_get_value (const struct lttng_event_field_value *field_val, const char **val) |
Sets *val to the raw value of the string event field value field_val. | |
| enum lttng_event_field_value_status | lttng_event_field_value_unsigned_int_get_value (const struct lttng_event_field_value *field_val, uint64_t *val) |
Sets *val to the raw value of the unsigned integer event field value field_val. | |
An event field value is the payload or context value of an event field.
See Event rule API to learn more about LTTng events.
When you create an “event rule matches” trigger condition, you may append capture descriptors with lttng_condition_event_rule_matches_append_capture_descriptor().
Then, when a trigger with such an “event rule matches” condition fires, the captured event field values are available through lttng_evaluation_event_rule_matches_get_captured_values().
Get the type of an event field value with lttng_event_field_value_get_type().
The available event field value types are:
| Event field value type | Type enumerator(s) | Accessors |
|---|---|---|
| Unsigned integer/enumeration | LTTNG_EVENT_FIELD_VALUE_TYPE_UNSIGNED_INT and LTTNG_EVENT_FIELD_VALUE_TYPE_UNSIGNED_ENUM | lttng_event_field_value_unsigned_int_get_value() |
| Signed integer/enumeration | LTTNG_EVENT_FIELD_VALUE_TYPE_SIGNED_INT and LTTNG_EVENT_FIELD_VALUE_TYPE_SIGNED_ENUM | lttng_event_field_value_signed_int_get_value() |
| Real number | LTTNG_EVENT_FIELD_VALUE_TYPE_REAL | lttng_event_field_value_real_get_value() |
| String | LTTNG_EVENT_FIELD_VALUE_TYPE_STRING | lttng_event_field_value_string_get_value() |
| Array | LTTNG_EVENT_FIELD_VALUE_TYPE_ARRAY | lttng_event_field_value_array_get_length() and lttng_event_field_value_array_get_element_at_index() |
Event field value type.
Get the type of an event field value with lttng_event_field_value_get_type().
| Enumerator | |
|---|---|
| LTTNG_EVENT_FIELD_VALUE_TYPE_UNSIGNED_INT | Unsigned integer. |
| LTTNG_EVENT_FIELD_VALUE_TYPE_SIGNED_INT | Signed integer. |
| LTTNG_EVENT_FIELD_VALUE_TYPE_UNSIGNED_ENUM | Unsigned enumeration. Conceptually inherits LTTNG_EVENT_FIELD_VALUE_TYPE_UNSIGNED_INT. |
| LTTNG_EVENT_FIELD_VALUE_TYPE_SIGNED_ENUM | Signed enumeration. Conceptually inherits LTTNG_EVENT_FIELD_VALUE_TYPE_SIGNED_INT. |
| LTTNG_EVENT_FIELD_VALUE_TYPE_REAL | Real number. |
| LTTNG_EVENT_FIELD_VALUE_TYPE_STRING | String. |
| LTTNG_EVENT_FIELD_VALUE_TYPE_ARRAY | Array. |
| LTTNG_EVENT_FIELD_VALUE_TYPE_INVALID | Unsatisfied precondition. |
| LTTNG_EVENT_FIELD_VALUE_TYPE_UNKNOWN | Unknown (error). |
|
extern |
Sets *elem_field_val to the element of the array event field value field_val at the index index.
It's possible that field_val doesn't actually have any element at the index index, in which case this function returns LTTNG_EVENT_FIELD_VALUE_STATUS_UNAVAILABLE.
| [in] | field_val | Array event field value of which to get the element at the index index. |
| [in] | index | Index of the element to get from field_val. |
| [out] | elem_field_val | On success, this function sets
|
| LTTNG_EVENT_FIELD_VALUE_STATUS_OK | Success. |
| LTTNG_EVENT_FIELD_VALUE_STATUS_INVALID | Unsatisfied precondition. |
| LTTNG_EVENT_FIELD_VALUE_STATUS_UNAVAILABLE | The element of field_val at the index index is not available. |
field_val is not NULL.field_val has the type LTTNG_EVENT_FIELD_VALUE_TYPE_ARRAY.index is less than the number of elements of field_val (as given by lttng_event_field_value_array_get_length()).elem_field_val is not NULL.
|
extern |
Sets *length to the length of the array event field value field_val.
| [in] | field_val | Array event field value of which to get the length. |
| [out] | length | On success, this function sets *length to the length of field_val. |
| LTTNG_EVENT_FIELD_VALUE_STATUS_OK | Success. |
| LTTNG_EVENT_FIELD_VALUE_STATUS_INVALID | Unsatisfied precondition. |
field_val is not NULL.field_val has the type LTTNG_EVENT_FIELD_VALUE_TYPE_ARRAY.length is not NULL.
|
extern |
Returns the type of the event field value field_val.
| [in] | field_val | Event field value of which to get the type. |
field_val.field_val is not NULL.
|
extern |
Sets *val to the raw value of the real number event field value field_val.
| [in] | field_val | Real number event field value of which to get the raw value. |
| [out] | val | On success, this function sets *val to the raw value of field_val. |
| LTTNG_EVENT_FIELD_VALUE_STATUS_OK | Success. |
| LTTNG_EVENT_FIELD_VALUE_STATUS_INVALID | Unsatisfied precondition. |
field_val is not NULL.field_val has the type LTTNG_EVENT_FIELD_VALUE_TYPE_REAL.val is not NULL.
|
extern |
Sets *val to the raw value of the signed integer event field value field_val.
| [in] | field_val | Signed integer event field value of which to get the raw value. |
| [out] | val | On success, this function sets *val to the raw value of field_val. |
| LTTNG_EVENT_FIELD_VALUE_STATUS_OK | Success. |
| LTTNG_EVENT_FIELD_VALUE_STATUS_INVALID | Unsatisfied precondition. |
field_val is not NULL.field_val has the type LTTNG_EVENT_FIELD_VALUE_TYPE_SIGNED_INT or LTTNG_EVENT_FIELD_VALUE_TYPE_SIGNED_ENUM.val is not NULL.
|
extern |
Sets *val to the raw value of the string event field value field_val.
| [in] | field_val | String event field value of which to get the raw value. |
| [out] | val | On success, this function sets
|
| LTTNG_EVENT_FIELD_VALUE_STATUS_OK | Success. |
| LTTNG_EVENT_FIELD_VALUE_STATUS_INVALID | Unsatisfied precondition. |
field_val is not NULL.field_val has the type LTTNG_EVENT_FIELD_VALUE_TYPE_STRING.val is not NULL.
|
extern |
Sets *val to the raw value of the unsigned integer event field value field_val.
| [in] | field_val | Unsigned integer event field value of which to get the raw value. |
| [out] | val | On success, this function sets *val to the raw value of field_val. |
| LTTNG_EVENT_FIELD_VALUE_STATUS_OK | Success. |
| LTTNG_EVENT_FIELD_VALUE_STATUS_INVALID | Unsatisfied precondition. |
field_val is not NULL.field_val has the type LTTNG_EVENT_FIELD_VALUE_TYPE_UNSIGNED_INT or LTTNG_EVENT_FIELD_VALUE_TYPE_UNSIGNED_ENUM.val is not NULL.