LTTng control library C API
Loading...
Searching...
No Matches
Collaboration diagram for Event field value 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_BLOB ,
  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_status lttng_event_field_value_blob_get_data (const struct lttng_event_field_value *field_val, const uint8_t **data)
 Sets *data to the data pointer of the BLOB event field value field_val.
 
enum lttng_event_field_value_status lttng_event_field_value_blob_get_length (const struct lttng_event_field_value *field_val, size_t *length)
 Sets *length to the length (byte count) of the BLOB event field value field_val.
 
enum lttng_event_field_value_status lttng_event_field_value_blob_get_media_type (const struct lttng_event_field_value *field_val, const char **media_type)
 Sets *media_type to the IANA media type of the BLOB 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.
 

Detailed Description

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()
BLOB (binary large object) LTTNG_EVENT_FIELD_VALUE_TYPE_BLOB lttng_event_field_value_blob_get_media_type(), lttng_event_field_value_blob_get_length(), and lttng_event_field_value_blob_get_data()
Array LTTNG_EVENT_FIELD_VALUE_TYPE_ARRAY lttng_event_field_value_array_get_length() and lttng_event_field_value_array_get_element_at_index()

Enumeration Type Documentation

◆ lttng_event_field_value_status

Return type of event field value API functions.

Enumerator
LTTNG_EVENT_FIELD_VALUE_STATUS_OK 

Success.

LTTNG_EVENT_FIELD_VALUE_STATUS_INVALID 

Unsatisfied precondition.

LTTNG_EVENT_FIELD_VALUE_STATUS_UNAVAILABLE 

Event field value is not available.

◆ lttng_event_field_value_type

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_BLOB 

BLOB (binary large object).

LTTNG_EVENT_FIELD_VALUE_TYPE_INVALID 

Unsatisfied precondition.

LTTNG_EVENT_FIELD_VALUE_TYPE_UNKNOWN 

Unknown (error).

Function Documentation

◆ lttng_event_field_value_array_get_element_at_index()

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 
)
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.

Parameters
[in]field_valArray event field value of which to get the element at the index index.
[in]indexIndex of the element to get from field_val.
[out]elem_field_val

On success, this function sets *elem_field_val to the element of field_val at the index index.

field_val owns *elem_field_val.

*elem_field_val remains valid until the next function call with field_val.

Return values
LTTNG_EVENT_FIELD_VALUE_STATUS_OKSuccess.
LTTNG_EVENT_FIELD_VALUE_STATUS_INVALIDUnsatisfied precondition.
LTTNG_EVENT_FIELD_VALUE_STATUS_UNAVAILABLEThe element of field_val at the index index is not available.
Precondition
See also
lttng_event_field_value_array_get_length() – Get the length of an array event field value.

◆ lttng_event_field_value_array_get_length()

enum lttng_event_field_value_status lttng_event_field_value_array_get_length ( const struct lttng_event_field_value *  field_val,
unsigned int *  length 
)
extern

Sets *length to the length of the array event field value field_val.

Parameters
[in]field_valArray event field value of which to get the length.
[out]lengthOn success, this function sets *length to the length of field_val.
Return values
LTTNG_EVENT_FIELD_VALUE_STATUS_OKSuccess.
LTTNG_EVENT_FIELD_VALUE_STATUS_INVALIDUnsatisfied precondition.
Precondition
See also
lttng_event_field_value_array_get_element_at_index() – Get an element of a an array event field value by index.

◆ lttng_event_field_value_blob_get_data()

enum lttng_event_field_value_status lttng_event_field_value_blob_get_data ( const struct lttng_event_field_value *  field_val,
const uint8_t **  data 
)
extern

Sets *data to the data pointer of the BLOB event field value field_val.

Parameters
[in]field_valBLOB event field value of which to get the data pointer.
[out]data

On success, this function sets *data to the data pointer of field_val.

The length of *data is what lttng_event_field_value_blob_get_length() returns with field_val.

field_val owns *data.

*data remains valid until the next function call with field_val.

Return values
LTTNG_EVENT_FIELD_VALUE_STATUS_OKSuccess.
LTTNG_EVENT_FIELD_VALUE_STATUS_INVALIDUnsatisfied precondition.
Precondition
See also
lttng_event_field_value_blob_get_length() – Get the length of a BLOB event field value.

◆ lttng_event_field_value_blob_get_length()

enum lttng_event_field_value_status lttng_event_field_value_blob_get_length ( const struct lttng_event_field_value *  field_val,
size_t *  length 
)
extern

Sets *length to the length (byte count) of the BLOB event field value field_val.

Parameters
[in]field_valBLOB event field value of which to get the length.
[out]lengthOn success, this function sets *length to the length of field_val.
Return values
LTTNG_EVENT_FIELD_VALUE_STATUS_OKSuccess.
LTTNG_EVENT_FIELD_VALUE_STATUS_INVALIDUnsatisfied precondition.
Precondition
See also
lttng_event_field_value_blob_get_data() – Get the data pointer of a BLOB event field value.

◆ lttng_event_field_value_blob_get_media_type()

enum lttng_event_field_value_status lttng_event_field_value_blob_get_media_type ( const struct lttng_event_field_value *  field_val,
const char **  media_type 
)
extern

Sets *media_type to the IANA media type of the BLOB event field value field_val.

Parameters
[in]field_valBLOB event field value of which to get the IANA media type.
[out]media_type

On success, this function sets *media_type to the IANA media type of field_val.

field_val owns *media_type.

*media_type remains valid until the next function call with field_val.

Return values
LTTNG_EVENT_FIELD_VALUE_STATUS_OKSuccess.
LTTNG_EVENT_FIELD_VALUE_STATUS_INVALIDUnsatisfied precondition.
Precondition

◆ lttng_event_field_value_get_type()

enum lttng_event_field_value_type lttng_event_field_value_get_type ( const struct lttng_event_field_value *  field_val)
extern

Returns the type of the event field value field_val.

Parameters
[in]field_valEvent field value of which to get the type.
Returns
Type of field_val.
Precondition
  • field_val is not NULL.

◆ lttng_event_field_value_real_get_value()

enum lttng_event_field_value_status lttng_event_field_value_real_get_value ( const struct lttng_event_field_value *  field_val,
double *  val 
)
extern

Sets *val to the raw value of the real number event field value field_val.

Parameters
[in]field_valReal number event field value of which to get the raw value.
[out]valOn success, this function sets *val to the raw value of field_val.
Return values
LTTNG_EVENT_FIELD_VALUE_STATUS_OKSuccess.
LTTNG_EVENT_FIELD_VALUE_STATUS_INVALIDUnsatisfied precondition.
Precondition

◆ lttng_event_field_value_signed_int_get_value()

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 
)
extern

Sets *val to the raw value of the signed integer event field value field_val.

Parameters
[in]field_valSigned integer event field value of which to get the raw value.
[out]valOn success, this function sets *val to the raw value of field_val.
Return values
LTTNG_EVENT_FIELD_VALUE_STATUS_OKSuccess.
LTTNG_EVENT_FIELD_VALUE_STATUS_INVALIDUnsatisfied precondition.
Precondition
See also
lttng_event_field_value_unsigned_int_get_value() – Get the raw value of an unsigned integer event field value.

◆ lttng_event_field_value_string_get_value()

enum lttng_event_field_value_status lttng_event_field_value_string_get_value ( const struct lttng_event_field_value *  field_val,
const char **  val 
)
extern

Sets *val to the raw value of the string event field value field_val.

Parameters
[in]field_valString 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.

field_val owns *val.

*val remains valid until the next function call with field_val.

Return values
LTTNG_EVENT_FIELD_VALUE_STATUS_OKSuccess.
LTTNG_EVENT_FIELD_VALUE_STATUS_INVALIDUnsatisfied precondition.
Precondition

◆ lttng_event_field_value_unsigned_int_get_value()

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 
)
extern

Sets *val to the raw value of the unsigned integer event field value field_val.

Parameters
[in]field_valUnsigned integer event field value of which to get the raw value.
[out]valOn success, this function sets *val to the raw value of field_val.
Return values
LTTNG_EVENT_FIELD_VALUE_STATUS_OKSuccess.
LTTNG_EVENT_FIELD_VALUE_STATUS_INVALIDUnsatisfied precondition.
Precondition
See also
lttng_event_field_value_signed_int_get_value() – Get the raw value of a signed integer event field value.