intrte_tel_data_start_array(structrte_tel_data*d,enumrte_tel_value_typetype)
Start an array of the specified type for returning from a callback
Parametersd The data structure passed to the callback
type The type of the array of data
Returns
0 on success, negative errno on error
intrte_tel_data_start_dict(structrte_tel_data*d)
Start a dictionary of values for returning from a callback
Dictionaries consist of key-values pairs to be returned, where the keys, or names, are strings and the
values can be any of the types supported by telemetry. Name strings may only contain alphanumeric
characters as well as '_' or '/'
Parametersd The data structure passed to the callback
Returns
0 on success, negative errno on error
intrte_tel_data_string(structrte_tel_data*d,constchar*str)
Set a string for returning from a callback
Parametersd The data structure passed to the callback
str The string to be returned in the data structure
Returns
0 on success, negative errno on error, E2BIG on string truncation
intrte_tel_data_add_array_string(structrte_tel_data*d,constchar*str)
Add a string to an array. The array must have been started by rte_tel_data_start_array() with
RTE_TEL_STRING_VAL as the type parameter.
Parametersd The data structure passed to the callback
str The string to be returned in the array
Returns
0 on success, negative errno on error, E2BIG on string truncation
intrte_tel_data_add_array_int(structrte_tel_data*d,int64_tx)
Add an int to an array. The array must have been started by rte_tel_data_start_array() with
RTE_TEL_INT_VAL as the type parameter.
Parametersd The data structure passed to the callback
x The number to be returned in the array
Returns
0 on success, negative errno on error
intrte_tel_data_add_array_uint(structrte_tel_data*d,uint64_tx)
Add an unsigned value to an array. The array must have been started by rte_tel_data_start_array() with
RTE_TEL_UINT_VAL as the type parameter.
Parametersd The data structure passed to the callback
x The number to be returned in the array
Returns
0 on success, negative errno on error
intrte_tel_data_add_array_u64(structrte_tel_data*d,uint64_tx)
Add a uint64_t to an array. The array must have been started by rte_tel_data_start_array() with
RTE_TEL_UINT_VAL as the type parameter.
Parametersd The data structure passed to the callback
x The number to be returned in the array
Returns
0 on success, negative errno on error
intrte_tel_data_add_array_container(structrte_tel_data*d,structrte_tel_data*val,intkeep)
Add a container to an array. A container is an existing telemetry data array. The array the container is
to be added to must have been started by rte_tel_data_start_array() with RTE_TEL_CONTAINER as the type
parameter. The container type must be an array of type uint64_t/int/string.
Parametersd The data structure passed to the callback
val The pointer to the container to be stored in the array.
keep Flag to indicate that the container memory should not be automatically freed by the telemetry
library once it has finished with the data. 1 = keep, 0 = free.
Returns
0 on success, negative errno on error
__rte_experimentalintrte_tel_data_add_array_uint_hex(structrte_tel_data*d,uint64_tval,uint8_tdisplay_bitwidth)
Convert an unsigned integer to hexadecimal encoded strings and add this string to an array. The array
must have been started by rte_tel_data_start_array() with RTE_TEL_STRING_VAL as the type parameter.
Parametersd The data structure passed to the callback.
val The number to be returned in the array as a hexadecimal encoded strings.
display_bitwidth The display bit width of the 'val'. If 'display_bitwidth' is zero, the value is
stored in the array as no-padding zero hexadecimal encoded string, or the value is stored as padding
zero to specified hexadecimal width.
Returns
0 on success, negative errno on error.
intrte_tel_data_add_dict_string(structrte_tel_data*d,constchar*name,constchar*val)
Add a string value to a dictionary. The dict must have been started by rte_tel_data_start_dict().
Parametersd The data structure passed to the callback
name The name the value is to be stored under in the dict Must contain only alphanumeric characters
or the symbols: '_' or '/'
val The string to be stored in the dict
Returns
0 on success, negative errno on error, E2BIG on string truncation of either name or value.
intrte_tel_data_add_dict_int(structrte_tel_data*d,constchar*name,int64_tval)
Add an int value to a dictionary. The dict must have been started by rte_tel_data_start_dict().
Parametersd The data structure passed to the callback
name The name the value is to be stored under in the dict Must contain only alphanumeric characters
or the symbols: '_' or '/'
val The number to be stored in the dict
Returns
0 on success, negative errno on error, E2BIG on string truncation of name.
intrte_tel_data_add_dict_uint(structrte_tel_data*d,constchar*name,uint64_tval)
Add an unsigned value to a dictionary. The dict must have been started by rte_tel_data_start_dict().
Parametersd The data structure passed to the callback
name The name the value is to be stored under in the dict Must contain only alphanumeric characters
or the symbols: '_' or '/'
val The number to be stored in the dict
Returns
0 on success, negative errno on error, E2BIG on string truncation of name.
intrte_tel_data_add_dict_u64(structrte_tel_data*d,constchar*name,uint64_tval)
Add a uint64_t value to a dictionary. The dict must have been started by rte_tel_data_start_dict().
Parametersd The data structure passed to the callback
name The name the value is to be stored under in the dict Must contain only alphanumeric characters
or the symbols: '_' or '/'
val The number to be stored in the dict
Returns
0 on success, negative errno on error, E2BIG on string truncation of name.
intrte_tel_data_add_dict_container(structrte_tel_data*d,constchar*name,structrte_tel_data*val,intkeep)
Add a container to a dictionary. A container is an existing telemetry data array. The dict the container
is to be added to must have been started by rte_tel_data_start_dict(). The container must be an array of
type uint64_t/int/string.
Parametersd The data structure passed to the callback
name The name the value is to be stored under in the dict. Must contain only alphanumeric characters
or the symbols: '_' or '/'
val The pointer to the container to be stored in the dict.
keep Flag to indicate that the container memory should not be automatically freed by the telemetry
library once it has finished with the data. 1 = keep, 0 = free.
Returns
0 on success, negative errno on error
__rte_experimentalintrte_tel_data_add_dict_uint_hex(structrte_tel_data*d,constchar*name,uint64_tval,uint8_tdisplay_bitwidth)
Convert an unsigned integer to hexadecimal encoded strings and add this string to an dictionary. The dict
must have been started by rte_tel_data_start_dict().
Parametersd The data structure passed to the callback.
name The name of the value is to be stored in the dict. Must contain only alphanumeric characters or
the symbols: '_' or '/'.
val The number to be stored in the dict as a hexadecimal encoded strings.
display_bitwidth The display bit width of the 'val'. If 'display_bitwidth' is zero, the value is
stored in the array as no-padding zero hexadecimal encoded string, or the value is stored as padding
zero to specified hexadecimal width.
Returns
0 on success, negative errno on error.
intrte_telemetry_register_cmd(constchar*cmd,telemetry_cbfn,constchar*help)
Used when registering a command and callback function with telemetry.
Parameterscmd The command to register with telemetry.
fn Callback function to be called when the command is requested.
help Help text for the command.
Returns
0 on success.
-EINVAL for invalid parameters failure.
-ENOMEM for mem allocation failure.
__rte_experimentalintrte_telemetry_register_cmd_arg(constchar*cmd,telemetry_arg_cbfn,void*arg,constchar*help)
Used when registering a command and callback function with telemetry.
Parameterscmd The command to register with telemetry.
fn Callback function to be called when the command is requested.
arg An opaque value that will be passed to the callback function.
help Help text for the command.
Returns
0 on success.
-EINVAL for invalid parameters failure.
-ENOMEM for mem allocation failure.
structrte_tel_data*rte_tel_data_alloc(void)
Get a pointer to a container with memory allocated. The container is to be used embedded within an
existing telemetry dict/array.
Returns
Pointer to a container.