LTTng control library C API
Loading...
Searching...
No Matches
Collaboration diagram for Data stream infos:

Data Structures

struct  lttng_data_stream_info
 Data stream info (opaque type). More...
 
struct  lttng_data_stream_info_set
 Data stream info set (opaque type). More...
 
struct  lttng_data_stream_info_sets
 Set of data stream info sets (opaque type). More...
 

Enumerations

enum  lttng_app_bitness { LTTNG_APP_BITNESS_32 , LTTNG_APP_BITNESS_64 }
 Bitness of an instrumented application. More...
 
enum  lttng_data_stream_info_status { LTTNG_DATA_STREAM_INFO_STATUS_OK , LTTNG_DATA_STREAM_INFO_STATUS_NONE , LTTNG_DATA_STREAM_INFO_STATUS_ERROR , LTTNG_DATA_STREAM_INFO_STATUS_INVALID_PARAMETER }
 Return type for data stream info functions. More...
 

Functions

enum lttng_data_stream_info_status lttng_data_stream_info_get_cpu_id (const struct lttng_data_stream_info *stream_info, unsigned int *cpu_id)
 Sets *cpu_id to the CPU ID of the data stream info stream_info.
 
enum lttng_data_stream_info_status lttng_data_stream_info_get_memory_usage (const struct lttng_data_stream_info *stream_info, uint64_t *value)
 Sets *value to the current memory usage (bytes) of the data stream info stream_info.
 
enum lttng_data_stream_info_status lttng_data_stream_info_set_get_app_bitness (const struct lttng_data_stream_info_set *set, enum lttng_app_bitness *bitness)
 Sets *bitness to the application bitness of the data streams of the data stream set set.
 
enum lttng_data_stream_info_status lttng_data_stream_info_set_get_at_index (const struct lttng_data_stream_info_set *set, unsigned int index, const struct lttng_data_stream_info **stream_info)
 Sets *stream_info to the data stream info at the index index in the data stream info set set.
 
enum lttng_data_stream_info_status lttng_data_stream_info_set_get_count (const struct lttng_data_stream_info_set *set, unsigned int *count)
 Sets *count to the number of data stream infos in the data stream info set set.
 
enum lttng_data_stream_info_status lttng_data_stream_info_set_get_pid (const struct lttng_data_stream_info_set *set, pid_t *pid)
 Sets *pid to the process ID of the owner of the data streams of the data stream info set set.
 
enum lttng_data_stream_info_status lttng_data_stream_info_set_get_uid (const struct lttng_data_stream_info_set *set, uid_t *uid)
 Sets *uid to the Unix user ID of the owner of the data streams of the data stream info set set.
 
void lttng_data_stream_info_sets_destroy (const struct lttng_data_stream_info_sets *sets)
 Destroys the set of data stream info sets sets.
 
enum lttng_data_stream_info_status lttng_data_stream_info_sets_get_at_index (const struct lttng_data_stream_info_sets *sets, unsigned int index, const struct lttng_data_stream_info_set **set)
 Sets *set to the data stream info set at the index index in the set of data stream info sets sets.
 
enum lttng_data_stream_info_status lttng_data_stream_info_sets_get_count (const struct lttng_data_stream_info_sets *sets, unsigned int *count)
 Sets *count to the number of data stream info sets in the set of data stream info sets sets.
 

Detailed Description

A data stream info (lttng_data_stream_info) represents information about a single data stream of a user space channel.

The main purpose of this API is to get the CPU ID (for a per-CPU channel only) and memory usage of the data streams of a channel.

A data stream info set (lttng_data_stream_info_set) contains data stream infos that share common ownership properties (same Unix user ID, process ID, or instrumented application bitness).

A set of data stream info sets (lttng_data_stream_info_sets) groups multiple data stream info sets for a given channel.

To get CPU ID and memory usage of the data streams of a channel:

  1. Retrieve data stream info sets for the channel with lttng_channel_get_data_stream_info_sets().

    This function returns a container of snapshots of information about data streams at call time: the returned object tree is immutable.

  2. For each data stream info set (use lttng_data_stream_info_sets_get_at_index() (borrowed) and lttng_data_stream_info_sets_get_count()):
    1. Get the ID of its owning Unix user/process and its application bitness with lttng_data_stream_info_set_get_uid(), lttng_data_stream_info_set_get_pid(), and lttng_data_stream_info_set_get_app_bitness().
    2. For each data stream info (use lttng_data_stream_info_set_get_at_index() (borrowed) and lttng_data_stream_info_set_get_count()):
  3. When you're done with the data stream info sets, destroy them with lttng_data_stream_info_sets_destroy().
Note
The content and availability of memory usage information may vary depending on tracer support.

Enumeration Type Documentation

◆ lttng_app_bitness

Bitness of an instrumented application.

Enumerator
LTTNG_APP_BITNESS_32 

32-bit.

LTTNG_APP_BITNESS_64 

64-bit.

◆ lttng_data_stream_info_status

Return type for data stream info functions.

Error status enumerators have a negative value.

Enumerator
LTTNG_DATA_STREAM_INFO_STATUS_OK 

Success.

LTTNG_DATA_STREAM_INFO_STATUS_NONE 

Information not available.

LTTNG_DATA_STREAM_INFO_STATUS_ERROR 

Other error.

LTTNG_DATA_STREAM_INFO_STATUS_INVALID_PARAMETER 

Unsatisfied precondition.

Function Documentation

◆ lttng_data_stream_info_get_cpu_id()

enum lttng_data_stream_info_status lttng_data_stream_info_get_cpu_id ( const struct lttng_data_stream_info stream_info,
unsigned int *  cpu_id 
)
extern

Sets *cpu_id to the CPU ID of the data stream info stream_info.

When a channel uses a per-CPU buffer ownership model, each data stream of the channel is bound to a specific CPU and therefore has a CPU ID. Otherwise, the CPU ID isn't set and this function returns LTTNG_DATA_STREAM_INFO_STATUS_NONE.

Parameters
[in]stream_infoData stream information from which to get the CPU ID.
[out]cpu_idOn success, this function sets *cpu_id to the ID of the CPU to which the data stream of stream_info is bound.
Return values
LTTNG_DATA_STREAM_INFO_STATUS_OKSuccess.
LTTNG_DATA_STREAM_INFO_STATUS_NONEThe data stream of stream_info isn't bound to a CPU.
LTTNG_DATA_STREAM_INFO_STATUS_INVALID_PARAMETERUnsatisfied precondition.
Precondition
  • stream_info is not NULL.
  • cpu_id is not NULL.

◆ lttng_data_stream_info_get_memory_usage()

enum lttng_data_stream_info_status lttng_data_stream_info_get_memory_usage ( const struct lttng_data_stream_info stream_info,
uint64_t *  value 
)
extern

Sets *value to the current memory usage (bytes) of the data stream info stream_info.

Parameters
[in]stream_infoData stream information object from which to get the memory usage.
[out]valueOn success, this function sets *value to the current memory usage (bytes) of stream_info.
Return values
LTTNG_DATA_STREAM_INFO_STATUS_OKSuccess.
LTTNG_DATA_STREAM_INFO_STATUS_INVALID_PARAMETERUnsatisfied precondition.
Precondition
  • stream_info is not NULL.
  • value is not NULL.

◆ lttng_data_stream_info_set_get_app_bitness()

enum lttng_data_stream_info_status lttng_data_stream_info_set_get_app_bitness ( const struct lttng_data_stream_info_set set,
enum lttng_app_bitness bitness 
)
extern

Sets *bitness to the application bitness of the data streams of the data stream set set.

Parameters
[in]setData stream set for which to get the application bitness.
[out]bitnessOn success, this function sets *bitness to the application bitness of the data streams of set.
Return values
LTTNG_DATA_STREAM_INFO_STATUS_OKSuccess.
LTTNG_DATA_STREAM_INFO_STATUS_INVALID_PARAMETERUnsatisfied precondition.
Precondition
  • set is not NULL.
  • bitness is not NULL.

◆ lttng_data_stream_info_set_get_at_index()

enum lttng_data_stream_info_status lttng_data_stream_info_set_get_at_index ( const struct lttng_data_stream_info_set set,
unsigned int  index,
const struct lttng_data_stream_info **  stream_info 
)
extern

Sets *stream_info to the data stream info at the index index in the data stream info set set.

Parameters
[in]setData stream info set from which to get the data stream info at the index index.
[in]indexIndex of the data stream info to get from set.
[out]stream_info

On success, this function sets *stream_info to the data stream info at the index index in set.

*stream_info remains valid as long as set exists.

Return values
LTTNG_DATA_STREAM_INFO_STATUS_OKSuccess.
LTTNG_DATA_STREAM_INFO_STATUS_INVALID_PARAMETERUnsatisfied precondition.
Precondition

◆ lttng_data_stream_info_set_get_count()

enum lttng_data_stream_info_status lttng_data_stream_info_set_get_count ( const struct lttng_data_stream_info_set set,
unsigned int *  count 
)
extern

Sets *count to the number of data stream infos in the data stream info set set.

Parameters
[in]setSet of data stream info of which to get the count.
[out]countOn success, this function sets *count to the number of data stream infos in set.
Return values
LTTNG_DATA_STREAM_INFO_STATUS_OKSuccess.
LTTNG_DATA_STREAM_INFO_STATUS_INVALID_PARAMETERUnsatisfied precondition.
Precondition
  • set is not NULL.
  • count is not NULL.
See also
lttng_data_stream_info_set_get_at_index() – Get a data stream info from a data stream info set by index.

◆ lttng_data_stream_info_set_get_pid()

enum lttng_data_stream_info_status lttng_data_stream_info_set_get_pid ( const struct lttng_data_stream_info_set set,
pid_t *  pid 
)
extern

Sets *pid to the process ID of the owner of the data streams of the data stream info set set.

If set represents per-user data streams, then the owner is a Unix user and this function returns LTTNG_DATA_STREAM_INFO_STATUS_NONE.

Parameters
[in]setData stream info set of which to get the ID of the owning process.
[out]pidOn success, this function sets *pid to the ID of the owning process of the data streams of set.
Return values
LTTNG_DATA_STREAM_INFO_STATUS_OKSuccess.
LTTNG_DATA_STREAM_INFO_STATUS_NONEset isn't owned by a process.
LTTNG_DATA_STREAM_INFO_STATUS_INVALID_PARAMETERUnsatisfied precondition.
Precondition
  • set is not NULL.
  • pid is not NULL.

◆ lttng_data_stream_info_set_get_uid()

enum lttng_data_stream_info_status lttng_data_stream_info_set_get_uid ( const struct lttng_data_stream_info_set set,
uid_t *  uid 
)
extern

Sets *uid to the Unix user ID of the owner of the data streams of the data stream info set set.

If set represents per-process data streams, then the owner is a process and this function returns LTTNG_DATA_STREAM_INFO_STATUS_NONE.

Parameters
[in]setData stream info set of which to get the ID of the owning Unix user.
[out]uidOn success, this function sets *uid to the ID of the Unix user owning the data streams of set.
Return values
LTTNG_DATA_STREAM_INFO_STATUS_OKSuccess.
LTTNG_DATA_STREAM_INFO_STATUS_NONEset isn't owned by a Unix user.
LTTNG_DATA_STREAM_INFO_STATUS_INVALID_PARAMETERUnsatisfied precondition.
Precondition
  • set is not NULL.
  • uid is not NULL.

◆ lttng_data_stream_info_sets_destroy()

void lttng_data_stream_info_sets_destroy ( const struct lttng_data_stream_info_sets sets)
extern

Destroys the set of data stream info sets sets.

Parameters
[in]sets

Set of data stream info sets to destroy.

May be NULL.

◆ lttng_data_stream_info_sets_get_at_index()

enum lttng_data_stream_info_status lttng_data_stream_info_sets_get_at_index ( const struct lttng_data_stream_info_sets sets,
unsigned int  index,
const struct lttng_data_stream_info_set **  set 
)
extern

Sets *set to the data stream info set at the index index in the set of data stream info sets sets.

Parameters
[in]setsSet of data stream info sets from which to get the data stream info set at the index index.
[in]indexIndex of the data stream info set to get from sets.
[out]set

On success, this function sets *set to the data stream info set at the index index in sets.

*set remains valid as long as sets exists.

Return values
LTTNG_DATA_STREAM_INFO_STATUS_OKSuccess.
LTTNG_DATA_STREAM_INFO_STATUS_INVALID_PARAMETERUnsatisfied precondition.
Precondition

◆ lttng_data_stream_info_sets_get_count()

enum lttng_data_stream_info_status lttng_data_stream_info_sets_get_count ( const struct lttng_data_stream_info_sets sets,
unsigned int *  count 
)
extern

Sets *count to the number of data stream info sets in the set of data stream info sets sets.

Parameters
[in]setsSet of data stream info sets of which to get the count.
[out]countOn success, this function sets *count to the number of data stream info sets in sets.
Return values
LTTNG_DATA_STREAM_INFO_STATUS_OKSuccess.
LTTNG_DATA_STREAM_INFO_STATUS_INVALID_PARAMETERUnsatisfied precondition.
Precondition
  • sets is not NULL.
  • count is not NULL.
See also
lttng_data_stream_info_sets_get_at_index() – Get a data stream info set from a set of data stream info sets by index.