Babeltrace 2 C API 2.1.0
Open-source trace manipulation framework
Loading...
Searching...
No Matches

Detailed Description

Elements exchanged between components.

Messages are the objects which are exchanged between components in a trace processing graph to accomplish a trace processing job.

Message iterators create messages while message iterators and sink components consume messages.

There are eight types of messages:

The type of a message is bt_message.

Get the type enumerator of a message with bt_message_get_type().

A message is a shared object: get a new reference with bt_message_get_ref() and put an existing reference with bt_message_put_ref().

Some library functions freeze messages on success. The documentation of those functions indicate this postcondition.

Messages transport objects of the Trace IR API, which is an intermediate representation of the tracing domain concepts.

All types of messages, except the message iterator inactivity message type, are related to a specific stream, which represents a conceptual sequence of messages.

Some types of messages can have a default clock snapshot, depending on whether or not their stream has a conceptual default clock, that is, whether or not the class of the stream has a default clock class. The creation functions for those types of messages contain _with_default_clock_snapshot (for example, bt_message_event_create_with_default_clock_snapshot()).

For the stream beginning message and stream end message, the default clock snapshot property is optional, therefore they have dedicated bt_message_stream_beginning_set_default_clock_snapshot() and bt_message_stream_end_set_default_clock_snapshot() functions.

All the message creation functions take a self message iterator as their first parameter. This is because a message iterator method is the only valid context to create a message.

Message types

This section details each type of message.

The following table shows the creation functions and types for each type of message:

Name Type enumerator Creation functions
Stream beginning BT_MESSAGE_TYPE_STREAM_BEGINNING bt_message_stream_beginning_create()
Stream end BT_MESSAGE_TYPE_STREAM_END bt_message_stream_end_create()
Event BT_MESSAGE_TYPE_EVENT bt_message_event_create()
bt_message_event_create_with_default_clock_snapshot()
bt_message_event_create_with_packet()
bt_message_event_create_with_packet_and_default_clock_snapshot()
Packet beginning BT_MESSAGE_TYPE_PACKET_BEGINNING bt_message_packet_beginning_create()
bt_message_packet_beginning_create_with_default_clock_snapshot()
Packet end BT_MESSAGE_TYPE_PACKET_END bt_message_packet_end_create()
bt_message_packet_end_create_with_default_clock_snapshot()
Discarded events BT_MESSAGE_TYPE_DISCARDED_EVENTS bt_message_discarded_events_create()
bt_message_discarded_events_create_with_default_clock_snapshots()
Discarded packets BT_MESSAGE_TYPE_DISCARDED_PACKETS bt_message_discarded_packets_create()
bt_message_discarded_packets_create_with_default_clock_snapshots()
Message iterator inactivity BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY bt_message_message_iterator_inactivity_create()

Stream beginning message

A stream beginning message indicates the beginning of a stream.

For a given stream:

Create a stream beginning message with bt_message_stream_beginning_create().

A stream beginning message has the following properties:

Stream

Stream of which the message indicates the beginning.

You cannot change the stream once the message is created.

Borrow the stream of a stream beginning message with bt_message_stream_beginning_borrow_stream() and bt_message_stream_beginning_borrow_stream_const().

Optional: Default clock snapshot

Snapshot of the default clock of the stream of the message when the stream begins.

A stream beginning message can only have a default clock snapshot if the class of its stream has a default clock class.

When a stream beginning message has no default clock snapshot, then its time is unknown.

Set the default clock snapshot of a stream beginning message with bt_message_stream_beginning_set_default_clock_snapshot().

Borrow the default clock snapshot of a stream beginning message with bt_message_stream_beginning_borrow_default_clock_snapshot_const().

Stream end message

A stream end message indicates the end of a stream.

For a given stream:

Create a stream end message with bt_message_stream_end_create().

A stream end message has the following properties:

Stream

Stream of which the message indicates the end.

You cannot change the stream once the message is created.

Borrow the stream of a stream end message with bt_message_stream_end_borrow_stream() and bt_message_stream_end_borrow_stream_const().

Optional: Default clock snapshot

Snapshot of the default clock of the stream of the message when the stream ends.

A stream end message can only have a default clock snapshot if the class of its stream has a default clock class.

When a stream end message has no default clock snapshot, then its time is unknown.

Set the default clock snapshot of a stream end message with bt_message_stream_end_set_default_clock_snapshot().

Borrow the default clock snapshot of a stream end message with bt_message_stream_end_borrow_default_clock_snapshot_const().

Event message

An event message transports an event and has, possibly, a default clock snapshot.

Within the message sequence of its stream, an event message can only occur:

If the class of the stream supports packets

After a packet beginning message and before a packet end message.

If the class of the stream doesn't support packets
After the stream beginning message and before the stream end message.

To create an event message for a given stream, use:

If the class of the stream supports packets
If the class of the stream has a default clock class

bt_message_event_create_with_packet_and_default_clock_snapshot()

If the class of the stream doesn't have a default clock class
bt_message_event_create_with_packet()

Those two creation functions accept a packet parameter which is the packet logically containing the event of the message. A packet is part of a stream.

If the class of the stream doesn't supports packets
If the class of the stream has a default clock class

bt_message_event_create_with_default_clock_snapshot()

If the class of the stream doesn't have a default clock class
bt_message_event_create()

The four creation functions above accept an event class parameter. When you create the message, the library instantiates this event class as an event. Borrow the resulting event with bt_message_event_borrow_event(). This event class must be part of the class of the stream of the event message.

The event of an event message is initially not set: before you emit the event message from the "next" method of a message iterator, you need to borrow each of its fields (with bt_event_borrow_payload_field(), bt_event_borrow_specific_context_field(), and bt_event_borrow_common_context_field()) and, recursively, set the values of the all their inner fields.

An event message has the following properties:

Event

Event which the message transports.

This is an instance of the event class which was passed to the creation function of the message.

With this event, you can access its packet (if any) with bt_event_borrow_packet_const() and its stream with bt_event_borrow_stream_const().

Borrow the event of an event message with bt_message_event_borrow_event() and bt_message_event_borrow_event_const().

Optional: Default clock snapshot

Snapshot of the default clock of the stream of the message when the event occurs.

An event message has a default clock snapshot if the class of its stream has a default clock class, and has none otherwise.

Within the message sequence of its message iterator, the default clock snapshot of an event message must be greater than or equal to any default clock snapshot of any previous message.

Borrow the default clock snapshot of an event message with bt_message_event_borrow_default_clock_snapshot_const().

Packet beginning message

A packet beginning message indicates the beginning of a packet.

A packet beginning message can only exist if the class of its stream supports packets.

For a given packet, there can be only one packet beginning message.

Within the message sequence of its stream, a packet beginning message can only occur after the stream beginning message and before the stream end message.

To create a packet beginning message for a given stream, use:

If, for the class of this stream, packets have a beginning default clock snapshot

bt_message_packet_beginning_create_with_default_clock_snapshot()

If, for the class of this stream, packets don't have a beginning default clock snapshot
bt_message_packet_beginning_create()

A packet beginning message has the following properties:

Packet

Packet of which the message indicates the beginning.

You cannot change the packet once the message is created.

Borrow the packet of a packet beginning message with bt_message_packet_beginning_borrow_packet() and bt_message_packet_beginning_borrow_packet_const().

Optional: Default clock snapshot

Snapshot of the default clock of the stream of the message when the packet begins.

A packet beginning message has a default clock snapshot if:

Within its the message sequence of its message iterator, the default clock snapshot of a packet beginning message must be greater than or equal to any clock snapshot of any previous message.

Borrow the default clock snapshot of a packet beginning message with bt_message_packet_beginning_borrow_default_clock_snapshot_const().

Packet end message

A packet end message indicates the end of a packet.

A packet end message can only exist if the class of its stream supports packets.

For a given packet, there can be only one packet end message.

Within the message sequence of its stream, a packet end message can only occur:

To create a packet end message for a given stream, use:

If, for the class of this stream, packets have an end default clock snapshot

bt_message_packet_end_create_with_default_clock_snapshot()

If, for the class of this stream, packets don't have an end default clock snapshot
bt_message_packet_end_create()

A packet end message has the following properties:

Packet

Packet of which the message indicates the end.

You cannot change the packet once the message is created.

Borrow the packet of a packet end message with bt_message_packet_end_borrow_packet() and bt_message_packet_end_borrow_packet_const().

Optional: Default clock snapshot

Snapshot of the default clock of the stream of the message when the packet ends.

A packet end message has a default clock snapshot if:

Within its the message sequence of its message iterator, the default clock snapshot of a packet end message must be greater than or equal to any clock snapshot of any previous message.

Borrow the default clock snapshot of a packet end message with bt_message_packet_end_borrow_default_clock_snapshot_const().

Discarded events message

A discarded events message indicates that events were discarded at tracing time. It does not indicate that event messages were dropped during a trace processing graph run.

A discarded events message can only exist if the class of its stream supports discarded events.

Within the message sequence of its stream, a discarded events message can only occur after the stream beginning message and before the stream end message.

To create a discarded events message for a given stream, use:

If, for the class of this stream, discarded events have default clock snapshots

bt_message_discarded_events_create_with_default_clock_snapshots()

If, for the class of this stream, discarded events don't have default clock snapshots
bt_message_discarded_events_create()

A discarded events message has the following properties:

Stream

Stream into which events were discarded.

You cannot change the stream once the message is created.

Borrow the stream of a discarded events message with bt_message_discarded_events_borrow_stream() and bt_message_discarded_events_borrow_stream_const().

Optional: Beginning default clock snapshot

Snapshot of the default clock of the stream of the message which indicates the beginning of the discarded events time range.

A discarded events message has a beginning default clock snapshot if:

Within its the message sequence of its message iterator, the beginning default clock snapshot of a discarded events message must be greater than or equal to any clock snapshot of any previous message.

Borrow the beginning default clock snapshot of a discarded events message with bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const().

Optional: End default clock snapshot

Snapshot of the default clock of the stream of the message which indicates the end of the discarded events time range.

A discarded events message has an end default clock snapshot if:

If a discarded events message has both a beginning and an end default clock snapshots, then the end default clock snapshot must be greater than or equal to the beginning default clock snapshot.

Within its the message sequence of its message iterator, the end default clock snapshot of a discarded events message must be greater than or equal to any clock snapshot of any previous message.

Borrow the end default clock snapshot of a discarded events message with bt_message_discarded_events_borrow_end_default_clock_snapshot_const().

Optional: Discarded event count

Exact number of discarded events.

If this property is missing, then the number of discarded events is at least one.

Use bt_message_discarded_events_set_count() and bt_message_discarded_events_get_count().

Discarded packets message

A discarded packets message indicates that packets were discarded at tracing time. It does not indicate that whole packets were dropped during a trace processing graph run.

A discarded packets message can only exist if the class of its stream supports discarded packets.

Within the message sequence of its stream, a discarded packets message can only occur:

To create a discarded packets message for a given stream, use:

If, for the class of this stream, discarded packets have default clock snapshots

bt_message_discarded_packets_create_with_default_clock_snapshots()

If, for the class of this stream, discarded packets don't have default clock snapshots
bt_message_discarded_packets_create()

A discarded packets message has the following properties:

Stream

Stream into which packets were discarded.

You cannot change the stream once the message is created.

Borrow the stream of a discarded packets message with bt_message_discarded_packets_borrow_stream() and bt_message_discarded_packets_borrow_stream_const().

Optional: Beginning default clock snapshot

Snapshot of the default clock of the stream of the message which indicates the beginning of the discarded packets time range.

A discarded packets message has a beginning default clock snapshot if:

Within its the message sequence of its message iterator, the beginning default clock snapshot of a discarded packets message must be greater than or equal to any clock snapshot of any previous message.

Borrow the beginning default clock snapshot of a discarded packets message with bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const().

Optional: End default clock snapshot

Snapshot of the default clock of the stream of the message which indicates the end of the discarded packets time range.

A discarded packets message has an end default clock snapshot if:

If a discarded packets message has both a beginning and an end default clock snapshots, then the end default clock snapshot must be greater than or equal to the beginning default clock snapshot.

Within its the message sequence of its message iterator, the end default clock snapshot of a discarded packets message must be greater than or equal to any clock snapshot of any previous message.

Borrow end default clock snapshot of a discarded packets message with bt_message_discarded_packets_borrow_end_default_clock_snapshot_const().

Optional: Discarded packet count

Exact number of discarded packets.

If this property is missing, then the number of discarded packets is at least one.

Use bt_message_discarded_packets_set_count() and bt_message_discarded_packets_get_count().

Message iterator inactivity

A message iterator inactivity message indicates that, within the message sequence of a given message iterator, there's no messages since the last message (if any) until a given point in time.

A message iterator inactivity message is the only type of message that's not related to a stream: it targets the whole message sequence of a message iterator, and can occur at any position within the sequence.

This message is mostly significant for real-time message iterators: if a message iterator A indicates that there's no messages until a given point in time T, then a downstream filter message iterator B which relies on multiple upstream message iterators doesn't have to wait for new messages from A until T.

In other words, a message iterator inactivity message can help downstream message iterators or sink components progress.

Create a message iterator inactivity message with bt_message_message_iterator_inactivity_create(). You must pass a clock class and the value of a fictitious (clock) instance to this function so that it creates a clock snapshot.

A message iterator inactivity message has the following property:

Optional: Clock snapshot

Snapshot of a fictitious instance of the clock class of the message which indicates the point in time until when there's no messages in the message sequence of the message iterator.

Within the message sequence of its message iterator, the clock snapshot of a message iterator inactivity message must be greater than or equal to any clock snapshot of any previous message.

Borrow the clock snapshot of a message iterator inactivity message with bt_message_message_iterator_inactivity_borrow_clock_snapshot_const().

Message Interchange Protocol (MIP)

The Message Interchange Protocol (MIP) is the system of rules used by components and message iterators to exchange messages within a trace processing graph.

The MIP covers everything related to messages and what they contain, as well as how they're ordered within the sequence that a message iterator produces.

For example:

The MIP has a version which is a single major number, independent from the version of the Babeltrace 2 project.

If what the MIP covers changes in a breaking or semantical way in the future, then the MIP and Babeltrace 2's minor versions will be bumped.

When you create a trace processing graph with bt_graph_create(), you must pass the effective MIP version to use. Then, the components you add to this graph can access this configured MIP version with bt_self_component_get_graph_mip_version() and behave accordingly. In other words, if the configured MIP version is 0, then a component cannot use features introduced by MIP version 1 (for example, create a BLOB field class).

The bt_graph_add_*_component*() functions have a precondition that the component to add supports the effective MIP version of the trace processing graph. To satisfy said precondition, create a component descriptor set with descriptors of the components you intend to add to a trace processing graph and call bt_get_greatest_operative_mip_version() or bt_get_greatest_operative_mip_version_with_restriction() (available since Babeltrace 2.1) to get the greatest (most recent) MIP version you can use.

To get the latest MIP version of the library, use bt_get_maximal_mip_version().

The ultimate goal of the MIP version feature is for the Babeltrace 2 project to be able to introduce new features or even major breaking changes without breaking existing component classes. This is especially important considering that Babeltrace 2 supports plugins written by different authors. Of course one of the objectives of the project is to bump the MIP version as rarely as possible. When it's required, though, it's a welcome tool to make the project evolve gracefully.

The Message Interchange Protocol has no dedicated documentation as this very message API (and its contained APIs, like Trace IR) documentation is enough. You can consider that all the functions of the message and trace IR objects have an implicit MIP version precondition. When a given function documentation doesn't explicitly document a MIP version precondition, it means that the effective MIP version has no effect on the behaviour of said function.

See Add MIP 1 support to your component class to learn how to add MIP 1 support to a component class written for MIP 0.

Message sequence rules

The purpose of a message iterator is to iterate a sequence of messages.

Those messages can be related to different streams:

Messages of multiple streams as a single message sequence for a given message iterator.

However, for such a message sequence, the current Message Interchange Protocol (version 1) dictates that:

Topics

 Trace IR
 Intermediate representation of tracing domain objects and concepts (contents of messages).
 

Type query

enum  bt_message_type {
  BT_MESSAGE_TYPE_STREAM_BEGINNING ,
  BT_MESSAGE_TYPE_STREAM_END ,
  BT_MESSAGE_TYPE_EVENT ,
  BT_MESSAGE_TYPE_PACKET_BEGINNING ,
  BT_MESSAGE_TYPE_PACKET_END ,
  BT_MESSAGE_TYPE_DISCARDED_EVENTS ,
  BT_MESSAGE_TYPE_DISCARDED_PACKETS ,
  BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY
}
 Message type enumerators. More...
 
typedef enum bt_message_type bt_message_type
 Message type enumerators.
 
bt_message_type bt_message_get_type (const bt_message *message)
 Returns the type enumerator of the message message.
 

Common stream message

enum  bt_message_stream_clock_snapshot_state {
  BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_KNOWN ,
  BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_UNKNOWN
}
 Return type of bt_message_stream_beginning_borrow_default_clock_snapshot_const() and bt_message_stream_end_borrow_default_clock_snapshot_const(). More...
 
typedef enum bt_message_stream_clock_snapshot_state bt_message_stream_clock_snapshot_state
 Return type of bt_message_stream_beginning_borrow_default_clock_snapshot_const() and bt_message_stream_end_borrow_default_clock_snapshot_const().
 

Message Interchange Protocol version

enum  bt_get_greatest_operative_mip_version_status {
  BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_OK ,
  BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_NO_MATCH ,
  BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_MEMORY_ERROR ,
  BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_ERROR
}
 Status codes for bt_get_greatest_operative_mip_version() and bt_get_greatest_operative_mip_version_with_restriction(). More...
 
typedef enum bt_get_greatest_operative_mip_version_status bt_get_greatest_operative_mip_version_status
 Status codes for bt_get_greatest_operative_mip_version() and bt_get_greatest_operative_mip_version_with_restriction().
 
bt_get_greatest_operative_mip_version_status bt_get_greatest_operative_mip_version (const bt_component_descriptor_set *component_descriptors, bt_logging_level logging_level, uint64_t *mip_version)
 Computes the greatest Message Interchange Protocol version which you can use to create a trace processing graph to which you intend to add components described by the component descriptors component_descriptors, and sets *mip_version to the result.
 
enum bt_get_greatest_operative_mip_version_status bt_get_greatest_operative_mip_version_with_restriction (const struct bt_component_descriptor_set *component_descriptors, enum bt_logging_level logging_level, const bt_integer_range_set_unsigned *mip_version_restriction, uint64_t *mip_version)
 Computes the greatest Message Interchange Protocol version, restricted to the set of versions mip_version_restriction, which you can use to create a trace processing graph to which you intend to add components described by the component descriptors component_descriptors, and sets *mip_version to the result.
 
uint64_t bt_get_maximal_mip_version (void)
 Returns the maximal available Message Interchange Protocol version as of Babeltrace 2.0.
 

Type

typedef struct bt_message bt_message
 Message.
 

Stream beginning message

bt_messagebt_message_stream_beginning_create (bt_self_message_iterator *self_message_iterator, const bt_stream *stream)
 Creates a stream beginning message for the stream stream from the message iterator self_message_iterator.
 
bt_streambt_message_stream_beginning_borrow_stream (bt_message *message)
 Borrows the stream of the stream beginning message message.
 
const bt_streambt_message_stream_beginning_borrow_stream_const (const bt_message *message)
 Borrows the stream of the stream beginning message message (const version).
 
void bt_message_stream_beginning_set_default_clock_snapshot (bt_message *message, uint64_t value)
 Sets the value, in clock cycles, of the default clock snapshot of the stream beginning message message to value.
 
bt_message_stream_clock_snapshot_state bt_message_stream_beginning_borrow_default_clock_snapshot_const (const bt_message *message, const bt_clock_snapshot **clock_snapshot)
 Borrows the default clock snapshot of the stream beginning message message.
 
const bt_clock_classbt_message_stream_beginning_borrow_stream_class_default_clock_class_const (const bt_message *message)
 Borrows the default clock class of the stream class of the stream beginning message message.
 

Stream end message

bt_messagebt_message_stream_end_create (bt_self_message_iterator *self_message_iterator, const bt_stream *stream)
 Creates a stream end message for the stream stream from the message iterator self_message_iterator.
 
bt_streambt_message_stream_end_borrow_stream (bt_message *message)
 Borrows the stream of the stream end message message.
 
const bt_streambt_message_stream_end_borrow_stream_const (const bt_message *message)
 Borrows the stream of the stream end message message (const version).
 
void bt_message_stream_end_set_default_clock_snapshot (bt_message *message, uint64_t value)
 Sets the value, in clock cycles, of the default clock snapshot of the stream end message message to value.
 
bt_message_stream_clock_snapshot_state bt_message_stream_end_borrow_default_clock_snapshot_const (const bt_message *message, const bt_clock_snapshot **clock_snapshot)
 Borrows the default clock snapshot of the stream end message message.
 
const bt_clock_classbt_message_stream_end_borrow_stream_class_default_clock_class_const (const bt_message *message)
 Borrows the default clock class of the stream class of the stream end message message.
 

Event message

bt_messagebt_message_event_create (bt_self_message_iterator *self_message_iterator, const bt_event_class *event_class, const bt_stream *stream)
 Creates an event message, having an instance of the event class event_class, for the stream stream from the message iterator self_message_iterator.
 
bt_messagebt_message_event_create_with_default_clock_snapshot (bt_self_message_iterator *self_message_iterator, const bt_event_class *event_class, const bt_stream *stream, uint64_t clock_snapshot_value)
 Creates an event message, having an instance of the event class event_class and a default clock snapshot with the value clock_snapshot_value, for the stream stream from the message iterator self_message_iterator.
 
bt_messagebt_message_event_create_with_packet (bt_self_message_iterator *self_message_iterator, const bt_event_class *event_class, const bt_packet *packet)
 Creates an event message, having an instance of the event class event_class, for the packet packet from the message iterator self_message_iterator.
 
bt_messagebt_message_event_create_with_packet_and_default_clock_snapshot (bt_self_message_iterator *self_message_iterator, const bt_event_class *event_class, const bt_packet *packet, uint64_t clock_snapshot_value)
 Creates an event message, having an instance of the event class event_class and a default clock snapshot with the value clock_snapshot_value, for the packet packet from the message iterator self_message_iterator.
 
bt_eventbt_message_event_borrow_event (bt_message *message)
 Borrows the event of the event message message.
 
const bt_eventbt_message_event_borrow_event_const (const bt_message *message)
 Borrows the event of the event message message (const version).
 
const bt_clock_snapshotbt_message_event_borrow_default_clock_snapshot_const (const bt_message *message)
 Borrows the default clock snapshot of the event message message.
 
const bt_clock_classbt_message_event_borrow_stream_class_default_clock_class_const (const bt_message *message)
 Borrows the default clock class of the stream class of the event message message.
 

Packet beginning message

bt_messagebt_message_packet_beginning_create (bt_self_message_iterator *self_message_iterator, const bt_packet *packet)
 Creates a packet beginning message for the packet packet from the message iterator self_message_iterator.
 
bt_messagebt_message_packet_beginning_create_with_default_clock_snapshot (bt_self_message_iterator *self_message_iterator, const bt_packet *packet, uint64_t clock_snapshot_value)
 Creates a packet beginning message having a default clock snapshot with the value clock_snapshot_value for the packet packet from the message iterator self_message_iterator.
 
bt_packetbt_message_packet_beginning_borrow_packet (bt_message *message)
 Borrows the packet of the packet beginning message message.
 
const bt_packetbt_message_packet_beginning_borrow_packet_const (const bt_message *message)
 Borrows the packet of the packet beginning message message (const version).
 
const bt_clock_snapshotbt_message_packet_beginning_borrow_default_clock_snapshot_const (const bt_message *message)
 Borrows the default clock snapshot of the packet beginning message message.
 
const bt_clock_classbt_message_packet_beginning_borrow_stream_class_default_clock_class_const (const bt_message *message)
 Borrows the default clock class of the stream class of the packet beginning message message.
 

Packet end message

bt_messagebt_message_packet_end_create (bt_self_message_iterator *self_message_iterator, const bt_packet *packet)
 Creates a packet end message for the packet packet from the message iterator self_message_iterator.
 
bt_messagebt_message_packet_end_create_with_default_clock_snapshot (bt_self_message_iterator *self_message_iterator, const bt_packet *packet, uint64_t clock_snapshot_value)
 Creates a packet end message having a default clock snapshot with the value clock_snapshot_value for the packet packet from the message iterator self_message_iterator.
 
bt_packetbt_message_packet_end_borrow_packet (bt_message *message)
 Borrows the packet of the packet end message message.
 
const bt_packetbt_message_packet_end_borrow_packet_const (const bt_message *message)
 Borrows the packet of the packet end message message (const version).
 
const bt_clock_snapshotbt_message_packet_end_borrow_default_clock_snapshot_const (const bt_message *message)
 Borrows the default clock snapshot of the packet end message message.
 
const bt_clock_classbt_message_packet_end_borrow_stream_class_default_clock_class_const (const bt_message *message)
 Borrows the default clock class of the stream class of the packet end message message.
 

Discarded events message

bt_messagebt_message_discarded_events_create (bt_self_message_iterator *self_message_iterator, const bt_stream *stream)
 Creates a discarded events message for the stream stream from the message iterator self_message_iterator.
 
bt_messagebt_message_discarded_events_create_with_default_clock_snapshots (bt_self_message_iterator *self_message_iterator, const bt_stream *stream, uint64_t beginning_clock_snapshot_value, uint64_t end_clock_snapshot_value)
 Creates a discarded events message having the beginning and end default clock snapshots with the values beginning_clock_snapshot_value and end_clock_snapshot_value for the stream stream from the message iterator self_message_iterator.
 
bt_streambt_message_discarded_events_borrow_stream (bt_message *message)
 Borrows the stream of the discarded events message message.
 
const bt_streambt_message_discarded_events_borrow_stream_const (const bt_message *message)
 Borrows the stream of the discarded events message message (const version).
 
const bt_clock_snapshotbt_message_discarded_events_borrow_beginning_default_clock_snapshot_const (const bt_message *message)
 Borrows the beginning default clock snapshot of the discarded events message message.
 
const bt_clock_snapshotbt_message_discarded_events_borrow_end_default_clock_snapshot_const (const bt_message *message)
 Borrows the end default clock snapshot of the discarded events message message.
 
const bt_clock_classbt_message_discarded_events_borrow_stream_class_default_clock_class_const (const bt_message *message)
 Borrows the default clock class of the stream class of the discarded events message message.
 
void bt_message_discarded_events_set_count (bt_message *message, uint64_t count)
 Sets the number of discarded events of the discarded events message message to count.
 
bt_property_availability bt_message_discarded_events_get_count (const bt_message *message, uint64_t *count)
 Returns the number of discarded events of the discarded events message message.
 

Discarded packets message

bt_messagebt_message_discarded_packets_create (bt_self_message_iterator *self_message_iterator, const bt_stream *stream)
 Creates a discarded packets message for the stream stream from the message iterator self_message_iterator.
 
bt_messagebt_message_discarded_packets_create_with_default_clock_snapshots (bt_self_message_iterator *self_message_iterator, const bt_stream *stream, uint64_t beginning_clock_snapshot_value, uint64_t end_clock_snapshot_value)
 Creates a discarded packets message having the beginning and end default clock snapshots with the values beginning_clock_snapshot_value and end_clock_snapshot_value for the stream stream from the message iterator self_message_iterator.
 
bt_streambt_message_discarded_packets_borrow_stream (bt_message *message)
 Borrows the stream of the discarded packets message message.
 
const bt_streambt_message_discarded_packets_borrow_stream_const (const bt_message *message)
 Borrows the stream of the discarded packets message message (const version).
 
const bt_clock_snapshotbt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const (const bt_message *message)
 Borrows the beginning default clock snapshot of the discarded packets message message.
 
const bt_clock_snapshotbt_message_discarded_packets_borrow_end_default_clock_snapshot_const (const bt_message *message)
 Borrows the end default clock snapshot of the discarded packets message message.
 
const bt_clock_classbt_message_discarded_packets_borrow_stream_class_default_clock_class_const (const bt_message *message)
 Borrows the default clock class of the stream class of the discarded packets message message.
 
void bt_message_discarded_packets_set_count (bt_message *message, uint64_t count)
 Sets the number of discarded packets of the discarded packets message message to count.
 
bt_property_availability bt_message_discarded_packets_get_count (const bt_message *message, uint64_t *count)
 Returns the number of discarded packets of the discarded packets message message.
 

Message iterator inactivity message

bt_messagebt_message_message_iterator_inactivity_create (bt_self_message_iterator *self_message_iterator, const bt_clock_class *clock_class, uint64_t clock_snapshot_value)
 Creates a message iterator inactivity message having a clock snapshot of a fictitious instance of the clock class clock_class with the value clock_snapshot_value from the message iterator self_message_iterator.
 
const bt_clock_snapshotbt_message_message_iterator_inactivity_borrow_clock_snapshot_const (const bt_message *message)
 Borrows the clock snapshot of the message iterator inactivity message message.
 

Message reference count

void bt_message_get_ref (const bt_message *message)
 Increments the reference count of the message message.
 
void bt_message_put_ref (const bt_message *message)
 Decrements the reference count of the message message.
 
#define BT_MESSAGE_PUT_REF_AND_RESET(_message)
 Decrements the reference count of the message _message, and then sets _message to NULL.
 
#define BT_MESSAGE_MOVE_REF(_dst, _src)
 Decrements the reference count of the message _dst, sets _dst to _src, and then sets _src to NULL.
 

Enumeration Type Documentation

◆ bt_message_type

Message type enumerators.

Enumerator
BT_MESSAGE_TYPE_STREAM_BEGINNING 

Stream beginning message.

BT_MESSAGE_TYPE_STREAM_END 

Stream end message.

BT_MESSAGE_TYPE_EVENT 

Event message.

BT_MESSAGE_TYPE_PACKET_BEGINNING 

Packet beginning message.

BT_MESSAGE_TYPE_PACKET_END 

Packet end message.

BT_MESSAGE_TYPE_DISCARDED_EVENTS 

Discarded events message.

BT_MESSAGE_TYPE_DISCARDED_PACKETS 

Discarded packets message.

BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY 

Message iterator inactivity message.

◆ bt_message_stream_clock_snapshot_state

Return type of bt_message_stream_beginning_borrow_default_clock_snapshot_const() and bt_message_stream_end_borrow_default_clock_snapshot_const().

Enumerator
BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_KNOWN 

Known clock snapshot.

BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_UNKNOWN 

Unknown (no) clock snapshot.

◆ bt_get_greatest_operative_mip_version_status

Status codes for bt_get_greatest_operative_mip_version() and bt_get_greatest_operative_mip_version_with_restriction().

Enumerator
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_OK 

Success.

BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_NO_MATCH 

No match found.

BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_MEMORY_ERROR 

Out of memory.

BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_ERROR 

Other error.

Macro Definition Documentation

◆ BT_MESSAGE_PUT_REF_AND_RESET

#define BT_MESSAGE_PUT_REF_AND_RESET ( _message)

Decrements the reference count of the message _message, and then sets _message to NULL.

Parameters
_message

Message of which to decrement the reference count.

Can contain NULL.

Precondition
_message is an assignable expression.

◆ BT_MESSAGE_MOVE_REF

#define BT_MESSAGE_MOVE_REF ( _dst,
_src )

Decrements the reference count of the message _dst, sets _dst to _src, and then sets _src to NULL.

This macro effectively moves a message reference from the expression _src to the expression _dst, putting the existing _dst reference.

Parameters
_dst

Destination expression.

Can contain NULL.

_src

Source expression.

Can contain NULL.

Precondition
_dst is an assignable expression.
_src is an assignable expression.

Function Documentation

◆ bt_message_get_type()

bt_message_type bt_message_get_type ( const bt_message * message)
extern

Returns the type enumerator of the message message.

Parameters
[in]messageMessage of which to get the type enumerator
Returns
Type enumerator of message.
Precondition
message is not NULL.

◆ bt_message_stream_beginning_create()

bt_message * bt_message_stream_beginning_create ( bt_self_message_iterator * self_message_iterator,
const bt_stream * stream )
extern

Creates a stream beginning message for the stream stream from the message iterator self_message_iterator.

On success, the returned stream beginning message has the following property values:

Property Value
Stream stream
Default clock snapshot None
Parameters
[in]self_message_iteratorSelf message iterator from which to create the stream beginning message.
[in]streamStream of which the message to create indicates the beginning.
Returns
New stream beginning message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
stream is not NULL.
Postcondition
On success, stream is frozen.

◆ bt_message_stream_beginning_borrow_stream()

bt_stream * bt_message_stream_beginning_borrow_stream ( bt_message * message)
extern

Borrows the stream of the stream beginning message message.

See the stream property.

Parameters
[in]messageStream beginning message from which to borrow the stream.
Returns

Borrowed reference of the stream of message.

The returned pointer remains valid as long as message exists.

Precondition
message is not NULL.
message is a stream beginning message.
See also
bt_message_stream_beginning_borrow_stream_const()const version of this function.

◆ bt_message_stream_beginning_borrow_stream_const()

const bt_stream * bt_message_stream_beginning_borrow_stream_const ( const bt_message * message)
extern

Borrows the stream of the stream beginning message message (const version).

See bt_message_stream_beginning_borrow_stream().

◆ bt_message_stream_beginning_set_default_clock_snapshot()

void bt_message_stream_beginning_set_default_clock_snapshot ( bt_message * message,
uint64_t value )
extern

Sets the value, in clock cycles, of the default clock snapshot of the stream beginning message message to value.

See the default clock snapshot property.

Parameters
[in]messageStream beginning message of which to set the default clock snapshot value to value.
[in]valueNew value (clock cycles) of the default clock snapshot of message.
Precondition
message is not NULL.
message is not frozen.
message is a stream beginning message.
The stream class of message has a default clock class.
See also
bt_message_stream_beginning_borrow_default_clock_snapshot_const() — Borrows the default clock snapshot of a stream beginning message.

◆ bt_message_stream_beginning_borrow_default_clock_snapshot_const()

bt_message_stream_clock_snapshot_state bt_message_stream_beginning_borrow_default_clock_snapshot_const ( const bt_message * message,
const bt_clock_snapshot ** clock_snapshot )
extern

Borrows the default clock snapshot of the stream beginning message message.

See the default clock snapshot property.

Parameters
[in]messageStream beginning message from which to borrow the default clock snapshot.
[out]clock_snapshotIf this function returns BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_KNOWN, then *clock_snapshot is a borrowed reference of the default clock snapshot of message.
Return values
BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_KNOWNThe default clock snapshot of message is known and returned as *clock_snapshot.
BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_UNKNOWNmessage has no default clock snapshot: its time is unknown.
Precondition
message is not NULL.
message is a stream beginning message.
The stream class of message has a default clock class.
clock_snapshot is not NULL.
See also
bt_message_stream_beginning_set_default_clock_snapshot() — Sets the default clock snapshot of a stream beginning message.

◆ bt_message_stream_beginning_borrow_stream_class_default_clock_class_const()

const bt_clock_class * bt_message_stream_beginning_borrow_stream_class_default_clock_class_const ( const bt_message * message)
extern

Borrows the default clock class of the stream class of the stream beginning message message.

See the default clock class property of a stream class.

This is a helper which is equivalent to

const bt_stream * bt_message_stream_beginning_borrow_stream_const(const bt_message *message)
Borrows the stream of the stream beginning message message (const version).
const bt_clock_class * bt_stream_class_borrow_default_clock_class_const(const bt_stream_class *stream_class)
Borrows the default clock class from the stream class stream_class (const version).
const bt_stream_class * bt_stream_borrow_class_const(const bt_stream *stream)
Borrows the class of the stream stream (const version).
Parameters
[in]messageStream beginning message from which to borrow the default clock class of the class of its stream.
Returns
Borrowed reference of the default clock class of the stream class of message, or NULL if none.
Precondition
message is not NULL.
message is a stream beginning message.

◆ bt_message_stream_end_create()

bt_message * bt_message_stream_end_create ( bt_self_message_iterator * self_message_iterator,
const bt_stream * stream )
extern

Creates a stream end message for the stream stream from the message iterator self_message_iterator.

On success, the returned stream end message has the following property values:

Property Value
Stream stream
Default clock snapshot None
Parameters
[in]self_message_iteratorSelf message iterator from which to create the stream end message.
[in]streamStream of which the message to create indicates the end.
Returns
New stream end message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
stream is not NULL.
Postcondition
On success, stream is frozen.

◆ bt_message_stream_end_borrow_stream()

bt_stream * bt_message_stream_end_borrow_stream ( bt_message * message)
extern

Borrows the stream of the stream end message message.

See the stream property.

Parameters
[in]messageStream end message from which to borrow the stream.
Returns

Borrowed reference of the stream of message.

The returned pointer remains valid as long as message exists.

Precondition
message is not NULL.
message is a stream end message.
See also
bt_message_stream_end_borrow_stream_const()const version of this function.

◆ bt_message_stream_end_borrow_stream_const()

const bt_stream * bt_message_stream_end_borrow_stream_const ( const bt_message * message)
extern

Borrows the stream of the stream end message message (const version).

See bt_message_stream_end_borrow_stream().

◆ bt_message_stream_end_set_default_clock_snapshot()

void bt_message_stream_end_set_default_clock_snapshot ( bt_message * message,
uint64_t value )
extern

Sets the value, in clock cycles, of the default clock snapshot of the stream end message message to value.

See the default clock snapshot property.

Parameters
[in]messageStream end message of which to set the default clock snapshot value to value.
[in]valueNew value (clock cycles) of the default clock snapshot of message.
Precondition
message is not NULL.
message is not frozen.
message is a stream end message.
The stream class of message has a default clock class.
See also
bt_message_stream_end_borrow_default_clock_snapshot_const() — Borrows the default clock snapshot of a stream end message.

◆ bt_message_stream_end_borrow_default_clock_snapshot_const()

bt_message_stream_clock_snapshot_state bt_message_stream_end_borrow_default_clock_snapshot_const ( const bt_message * message,
const bt_clock_snapshot ** clock_snapshot )
extern

Borrows the default clock snapshot of the stream end message message.

See the default clock snapshot property.

Parameters
[in]messageStream end message from which to borrow the default clock snapshot.
[out]clock_snapshotIf this function returns BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_KNOWN, then *clock_snapshot is a borrowed reference of the default clock snapshot of message.
Return values
BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_KNOWNThe default clock snapshot of message is known and returned as *clock_snapshot.
BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_UNKNOWNmessage has no default clock snapshot: its time is unknown.
Precondition
message is not NULL.
message is a stream end message.
The stream class of message has a default clock class.
clock_snapshot is not NULL.
See also
bt_message_stream_end_set_default_clock_snapshot() — Sets the default clock snapshot of a stream end message.

◆ bt_message_stream_end_borrow_stream_class_default_clock_class_const()

const bt_clock_class * bt_message_stream_end_borrow_stream_class_default_clock_class_const ( const bt_message * message)
extern

Borrows the default clock class of the stream class of the stream end message message.

See the default clock class property of a stream class.

This is a helper which is equivalent to

const bt_stream * bt_message_stream_end_borrow_stream_const(const bt_message *message)
Borrows the stream of the stream end message message (const version).
Parameters
[in]messageStream end message from which to borrow the default clock class of the class of its stream.
Returns
Borrowed reference of the default clock class of the stream class of message, or NULL if none.
Precondition
message is not NULL.
message is a stream end message.

◆ bt_message_event_create()

bt_message * bt_message_event_create ( bt_self_message_iterator * self_message_iterator,
const bt_event_class * event_class,
const bt_stream * stream )
extern

Creates an event message, having an instance of the event class event_class, for the stream stream from the message iterator self_message_iterator.

Attention

Only use this function if

bt_bool bt_stream_class_supports_packets(const bt_stream_class *stream_class)
Returns whether or not the instances (streams) of the stream class stream_class have packets.

returns BT_FALSE and

returns NULL.

Otherwise, use bt_message_event_create_with_default_clock_snapshot(), bt_message_event_create_with_packet(), or bt_message_event_create_with_packet_and_default_clock_snapshot().

On success, the returned event message has the following property values:

Property Value
Event An instance (with fields that aren't set) of event_class.
Default clock snapshot None
Parameters
[in]self_message_iteratorSelf message iterator from which to create the event message.
[in]event_classClass of the event of the message to create.
[in]streamStream conceptually containing the event of the message to create.
Returns
New event message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
The stream class of event_class is also the class of stream, that is, bt_event_class_borrow_stream_class_const(event_class) and bt_stream_borrow_class_const(stream) have the same value.
stream is not NULL.
bt_stream_class_supports_packets(bt_stream_borrow_class_const(stream)) returns BT_FALSE.
bt_stream_class_borrow_default_clock_class_const(bt_stream_borrow_class_const(stream)) returns NULL.
Postcondition
On success, event_class is frozen.
On success, stream is frozen.

◆ bt_message_event_create_with_default_clock_snapshot()

bt_message * bt_message_event_create_with_default_clock_snapshot ( bt_self_message_iterator * self_message_iterator,
const bt_event_class * event_class,
const bt_stream * stream,
uint64_t clock_snapshot_value )
extern

Creates an event message, having an instance of the event class event_class and a default clock snapshot with the value clock_snapshot_value, for the stream stream from the message iterator self_message_iterator.

Attention

Only use this function if

returns BT_FALSE and

does not return NULL.

Otherwise, use bt_message_event_create(), bt_message_event_create_with_packet(), or bt_message_event_create_with_packet_and_default_clock_snapshot().

On success, the returned event message has the following property values:

Property Value
Event An instance (with fields that aren't set) of event_class.
Default clock snapshot Clock snapshot with the value clock_snapshot_value.
Parameters
[in]self_message_iteratorSelf message iterator from which to create the event message.
[in]event_classClass of the event of the message to create.
[in]streamStream conceptually containing the event of the message to create.
[in]clock_snapshot_valueValue (clock cycles) of the default clock snapshot of message.
Returns
New event message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
The stream class of event_class is also the class of stream, that is, bt_event_class_borrow_stream_class_const(event_class) and bt_stream_borrow_class_const(stream) have the same value.
stream is not NULL.
bt_stream_class_supports_packets(bt_stream_borrow_class_const(stream)) returns BT_FALSE.
bt_stream_class_borrow_default_clock_class_const(bt_stream_borrow_class_const(stream)) does not return NULL.
Postcondition
On success, event_class is frozen.
On success, stream is frozen.

◆ bt_message_event_create_with_packet()

bt_message * bt_message_event_create_with_packet ( bt_self_message_iterator * self_message_iterator,
const bt_event_class * event_class,
const bt_packet * packet )
extern

Creates an event message, having an instance of the event class event_class, for the packet packet from the message iterator self_message_iterator.

Attention

Only use this function if

const bt_stream * bt_packet_borrow_stream_const(const bt_packet *packet)
Borrows the stream conceptually containing the packet packet (const version).

returns BT_TRUE and

returns NULL.

Otherwise, use bt_message_event_create(), bt_message_event_create_with_default_clock_snapshot(), or bt_message_event_create_with_packet_and_default_clock_snapshot().

On success, the returned event message has the following property values:

Property Value
Event An instance (with fields that aren't set) of event_class.
Default clock snapshot None
Parameters
[in]self_message_iteratorSelf message iterator from which to create the event message.
[in]event_classClass of the event of the message to create.
[in]packetPacket conceptually containing the event of the message to create.
Returns
New event message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
The stream class of event_class is also the stream class of packet, that is, bt_event_class_borrow_stream_class_const(event_class) and bt_stream_borrow_class_const(bt_packet_borrow_stream_const(packet)) have the same value.
packet is not NULL.
bt_stream_class_supports_packets(bt_stream_borrow_class_const(bt_packet_borrow_stream_const(packet))) returns BT_TRUE.
bt_stream_class_borrow_default_clock_class_const(bt_stream_borrow_class_const(bt_packet_borrow_stream_const(packet))) returns NULL.
The context field of packet, if any, and all its contained fields, recursively, are set.
Postcondition
On success, event_class is frozen.
On success, packet is frozen.

◆ bt_message_event_create_with_packet_and_default_clock_snapshot()

bt_message * bt_message_event_create_with_packet_and_default_clock_snapshot ( bt_self_message_iterator * self_message_iterator,
const bt_event_class * event_class,
const bt_packet * packet,
uint64_t clock_snapshot_value )
extern

Creates an event message, having an instance of the event class event_class and a default clock snapshot with the value clock_snapshot_value, for the packet packet from the message iterator self_message_iterator.

Attention

Only use this function if

returns BT_TRUE and

does not return NULL.

Otherwise, use bt_message_event_create(), bt_message_event_create_with_default_clock_snapshot(), or bt_message_event_create_with_packet().

On success, the returned event message has the following property values:

Property Value
Event An instance (with fields that aren't set) of event_class.
Default clock snapshot Clock snapshot with the value clock_snapshot_value.
Parameters
[in]self_message_iteratorSelf message iterator from which to create the event message.
[in]event_classClass of the event of the message to create.
[in]packetPacket conceptually containing the event of the message to create.
[in]clock_snapshot_valueValue (clock cycles) of the default clock snapshot of message.
Returns
New event message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
The stream class of event_class is also the stream class of packet, that is, bt_event_class_borrow_stream_class_const(event_class) and bt_stream_borrow_class_const(bt_packet_borrow_stream_const(packet)) have the same value.
packet is not NULL.
bt_stream_class_supports_packets(bt_stream_borrow_class_const(bt_packet_borrow_stream_const(packet))) returns BT_TRUE.
bt_stream_class_borrow_default_clock_class_const(bt_stream_borrow_class_const(bt_packet_borrow_stream_const(packet))) does not return NULL.
The context field of packet, if any, and all its contained fields, recursively, are set.
Postcondition
On success, event_class is frozen.
On success, stream is frozen.

◆ bt_message_event_borrow_event()

bt_event * bt_message_event_borrow_event ( bt_message * message)
extern

Borrows the event of the event message message.

See the event property.

Parameters
[in]messageEvent message from which to borrow the event.
Returns

Borrowed reference of the event of message.

The returned pointer remains valid as long as message exists.

Precondition
message is not NULL.
message is an event message.
See also
bt_message_event_borrow_event_const()const version of this function.

◆ bt_message_event_borrow_event_const()

const bt_event * bt_message_event_borrow_event_const ( const bt_message * message)
extern

Borrows the event of the event message message (const version).

See bt_message_event_borrow_event().

◆ bt_message_event_borrow_default_clock_snapshot_const()

const bt_clock_snapshot * bt_message_event_borrow_default_clock_snapshot_const ( const bt_message * message)
extern

Borrows the default clock snapshot of the event message message.

See the default clock snapshot property.

Parameters
[in]messageEvent message from which to borrow the default clock snapshot.
Returns
Default clock snapshot of message.
Precondition
message is not NULL.
message is an event message.
The stream class of message has a default clock class.

◆ bt_message_event_borrow_stream_class_default_clock_class_const()

const bt_clock_class * bt_message_event_borrow_stream_class_default_clock_class_const ( const bt_message * message)
extern

Borrows the default clock class of the stream class of the event message message.

See the default clock class property of a stream class.

This is a helper which is equivalent to

const bt_event * bt_message_event_borrow_event_const(const bt_message *message)
Borrows the event of the event message message (const version).
const bt_stream * bt_event_borrow_stream_const(const bt_event *event)
Borrows the stream conceptually containing the event event (const version).
Parameters
[in]messageEvent message from which to borrow the default clock class of the class of its stream.
Returns
Borrowed reference of the default clock class of the stream class of message, or NULL if none.
Precondition
message is not NULL.
message is an event message.

◆ bt_message_packet_beginning_create()

bt_message * bt_message_packet_beginning_create ( bt_self_message_iterator * self_message_iterator,
const bt_packet * packet )
extern

Creates a packet beginning message for the packet packet from the message iterator self_message_iterator.

Attention

Only use this function if

bt_bool bt_stream_class_packets_have_beginning_default_clock_snapshot(const bt_stream_class *stream_class)
Returns whether or not the packets of the instances (streams) of the stream class stream_class have a...

returns BT_FALSE.

Otherwise, use bt_message_packet_beginning_create_with_default_clock_snapshot().

On success, the returned packet beginning message has the following property values:

Property Value
Packet packet
Default clock snapshot None
Parameters
[in]self_message_iteratorSelf message iterator from which to create the packet beginning message.
[in]packetPacket of which the message to create indicates the beginning.
Returns
New packet beginning message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
packet is not NULL.
bt_stream_class_packets_have_beginning_default_clock_snapshot() returns BT_FALSE for bt_stream_borrow_class_const(bt_packet_borrow_stream_const(packet)).
The context field of packet, if any, and all its contained fields, recursively, are set.
Postcondition
On success, packet is frozen.

◆ bt_message_packet_beginning_create_with_default_clock_snapshot()

bt_message * bt_message_packet_beginning_create_with_default_clock_snapshot ( bt_self_message_iterator * self_message_iterator,
const bt_packet * packet,
uint64_t clock_snapshot_value )
extern

Creates a packet beginning message having a default clock snapshot with the value clock_snapshot_value for the packet packet from the message iterator self_message_iterator.

Attention

Only use this function if

returns BT_TRUE.

Otherwise, use bt_message_packet_beginning_create().

On success, the returned packet beginning message has the following property values:

Property Value
Packet packet
Default clock snapshot Clock snapshot with the value clock_snapshot_value.
Parameters
[in]self_message_iteratorSelf message iterator from which to create the packet beginning message.
[in]packetPacket of which the message to create indicates the beginning.
[in]clock_snapshot_valueValue (clock cycles) of the default clock snapshot of message.
Returns
New packet beginning message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
packet is not NULL.
bt_stream_class_packets_have_beginning_default_clock_snapshot() returns BT_TRUE for bt_stream_borrow_class_const(bt_packet_borrow_stream_const(packet)).
The context field of packet, if any, and all its contained fields, recursively, are set.
Postcondition
On success, packet is frozen.

◆ bt_message_packet_beginning_borrow_packet()

bt_packet * bt_message_packet_beginning_borrow_packet ( bt_message * message)
extern

Borrows the packet of the packet beginning message message.

See the packet property.

Parameters
[in]messagePacket beginning message from which to borrow the packet.
Returns

Borrowed reference of the packet of message.

The returned pointer remains valid as long as message exists.

Precondition
message is not NULL.
message is a packet beginning message.
See also
bt_message_packet_beginning_borrow_packet_const()const version of this function.

◆ bt_message_packet_beginning_borrow_packet_const()

const bt_packet * bt_message_packet_beginning_borrow_packet_const ( const bt_message * message)
extern

Borrows the packet of the packet beginning message message (const version).

See bt_message_packet_beginning_borrow_packet().

◆ bt_message_packet_beginning_borrow_default_clock_snapshot_const()

const bt_clock_snapshot * bt_message_packet_beginning_borrow_default_clock_snapshot_const ( const bt_message * message)
extern

Borrows the default clock snapshot of the packet beginning message message.

See the default clock snapshot property.

Parameters
[in]messagePacket beginning message from which to borrow the default clock snapshot.
Returns
Default clock snapshot of message.
Precondition
message is not NULL.
message is a packet beginning message.
The packets of the stream class of message have a beginning default clock snapshot.

◆ bt_message_packet_beginning_borrow_stream_class_default_clock_class_const()

const bt_clock_class * bt_message_packet_beginning_borrow_stream_class_default_clock_class_const ( const bt_message * message)
extern

Borrows the default clock class of the stream class of the packet beginning message message.

See the default clock class property of a stream class.

This is a helper which is equivalent to

const bt_packet * bt_message_packet_beginning_borrow_packet_const(const bt_message *message)
Borrows the packet of the packet beginning message message (const version).
Parameters
[in]messagePacket beginning message from which to borrow the default clock class of the class of its stream.
Returns
Borrowed reference of the default clock class of the stream class of message, or NULL if none.
Precondition
message is not NULL.
message is a packet beginning message.

◆ bt_message_packet_end_create()

bt_message * bt_message_packet_end_create ( bt_self_message_iterator * self_message_iterator,
const bt_packet * packet )
extern

Creates a packet end message for the packet packet from the message iterator self_message_iterator.

Attention

Only use this function if

bt_bool bt_stream_class_packets_have_end_default_clock_snapshot(const bt_stream_class *stream_class)
Returns whether or not the packets of the instances (streams) of the stream class stream_class have a...

returns BT_FALSE.

Otherwise, use bt_message_packet_end_create_with_default_clock_snapshot().

On success, the returned packet end message has the following property values:

Property Value
Packet packet
Default clock snapshot None
Parameters
[in]self_message_iteratorSelf message iterator from which to create the packet end message.
[in]packetPacket of which the message to create indicates the end.
Returns
New packet end message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
packet is not NULL.
bt_stream_class_packets_have_end_default_clock_snapshot() returns BT_FALSE for bt_stream_borrow_class_const(bt_packet_borrow_stream_const(packet)).
The context field of packet, if any, and all its contained fields, recursively, are set.
Postcondition
On success, packet is frozen.

◆ bt_message_packet_end_create_with_default_clock_snapshot()

bt_message * bt_message_packet_end_create_with_default_clock_snapshot ( bt_self_message_iterator * self_message_iterator,
const bt_packet * packet,
uint64_t clock_snapshot_value )
extern

Creates a packet end message having a default clock snapshot with the value clock_snapshot_value for the packet packet from the message iterator self_message_iterator.

Attention

Only use this function if

returns BT_TRUE.

Otherwise, use bt_message_packet_end_create().

On success, the returned packet end message has the following property values:

Property Value
Packet packet
Default clock snapshot Clock snapshot with the value clock_snapshot_value.
Parameters
[in]self_message_iteratorSelf message iterator from which to create the packet end message.
[in]packetPacket of which the message to create indicates the end.
[in]clock_snapshot_valueValue (clock cycles) of the default clock snapshot of message.
Returns
New packet end message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
packet is not NULL.
bt_stream_class_packets_have_end_default_clock_snapshot() returns BT_TRUE for bt_stream_borrow_class_const(bt_packet_borrow_stream_const(packet)).
The context field of packet, if any, and all its contained fields, recursively, are set.
Postcondition
On success, packet is frozen.

◆ bt_message_packet_end_borrow_packet()

bt_packet * bt_message_packet_end_borrow_packet ( bt_message * message)
extern

Borrows the packet of the packet end message message.

See the packet property.

Parameters
[in]messagePacket end message from which to borrow the packet.
Returns

Borrowed reference of the packet of message.

The returned pointer remains valid as long as message exists.

Precondition
message is not NULL.
message is a packet end message.
See also
bt_message_packet_end_borrow_packet_const()const version of this function.

◆ bt_message_packet_end_borrow_packet_const()

const bt_packet * bt_message_packet_end_borrow_packet_const ( const bt_message * message)
extern

Borrows the packet of the packet end message message (const version).

See bt_message_packet_end_borrow_packet().

◆ bt_message_packet_end_borrow_default_clock_snapshot_const()

const bt_clock_snapshot * bt_message_packet_end_borrow_default_clock_snapshot_const ( const bt_message * message)
extern

Borrows the default clock snapshot of the packet end message message.

See the default clock snapshot property.

Parameters
[in]messagePacket end message from which to borrow the default clock snapshot.
Returns
Default clock snapshot of message.
Precondition
message is not NULL.
message is a packet end message.
The packets of the stream class of message have an end default clock snapshot.

◆ bt_message_packet_end_borrow_stream_class_default_clock_class_const()

const bt_clock_class * bt_message_packet_end_borrow_stream_class_default_clock_class_const ( const bt_message * message)
extern

Borrows the default clock class of the stream class of the packet end message message.

See the default clock class property of a stream class.

This is a helper which is equivalent to

const bt_packet * bt_message_packet_end_borrow_packet_const(const bt_message *message)
Borrows the packet of the packet end message message (const version).
Parameters
[in]messagePacket end message from which to borrow the default clock class of the class of its stream.
Returns
Borrowed reference of the default clock class of the stream class of message, or NULL if none.
Precondition
message is not NULL.
message is a packet end message.

◆ bt_message_discarded_events_create()

bt_message * bt_message_discarded_events_create ( bt_self_message_iterator * self_message_iterator,
const bt_stream * stream )
extern

Creates a discarded events message for the stream stream from the message iterator self_message_iterator.

Attention

Only use this function if

bt_bool bt_stream_class_discarded_events_have_default_clock_snapshots(const bt_stream_class *stream_class)
Returns whether or not the discarded events messages of the instances (streams) of the stream class s...

returns BT_FALSE.

Otherwise, use bt_message_discarded_events_create_with_default_clock_snapshots().

On success, the returned discarded events message has the following property values:

Property Value
Stream stream
Beginning default clock snapshot None
End default clock snapshot None
Discarded event count None
Parameters
[in]self_message_iteratorSelf message iterator from which to create the discarded events message.
[in]streamStream from which the events were discarded.
Returns
New discarded events message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
stream is not NULL.
bt_stream_class_discarded_events_have_default_clock_snapshots(bt_stream_borrow_class_const(stream)) returns BT_FALSE.
Postcondition
On success, stream is frozen.

◆ bt_message_discarded_events_create_with_default_clock_snapshots()

bt_message * bt_message_discarded_events_create_with_default_clock_snapshots ( bt_self_message_iterator * self_message_iterator,
const bt_stream * stream,
uint64_t beginning_clock_snapshot_value,
uint64_t end_clock_snapshot_value )
extern

Creates a discarded events message having the beginning and end default clock snapshots with the values beginning_clock_snapshot_value and end_clock_snapshot_value for the stream stream from the message iterator self_message_iterator.

Attention

Only use this function if

returns BT_TRUE.

Otherwise, use bt_message_discarded_events_create().

On success, the returned discarded events message has the following property values:

Property Value
Stream stream
Beginning default clock snapshot Clock snapshot with the value beginning_clock_snapshot_value.
End default clock snapshot Clock snapshot with the value end_clock_snapshot_value.
Discarded event count None
Parameters
[in]self_message_iteratorSelf message iterator from which to create the discarded events message.
[in]streamStream from which the events were discarded.
[in]beginning_clock_snapshot_valueValue (clock cycles) of the beginning default clock snapshot of message.
[in]end_clock_snapshot_valueValue (clock cycles) of the end default clock snapshot of message.
Returns
New discarded events message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
stream is not NULL.
bt_stream_class_discarded_events_have_default_clock_snapshots(bt_stream_borrow_class_const(stream)) returns BT_TRUE.
beginning_clock_snapshot_valueend_clock_snapshot_value
Postcondition
On success, stream is frozen.

◆ bt_message_discarded_events_borrow_stream()

bt_stream * bt_message_discarded_events_borrow_stream ( bt_message * message)
extern

Borrows the stream of the discarded events message message.

See the stream property.

Parameters
[in]messageDiscarded events message from which to borrow the stream.
Returns

Borrowed reference of the stream of message.

The returned pointer remains valid as long as message exists.

Precondition
message is not NULL.
message is a discarded events message.
See also
bt_message_discarded_events_borrow_stream_const()const version of this function.

◆ bt_message_discarded_events_borrow_stream_const()

const bt_stream * bt_message_discarded_events_borrow_stream_const ( const bt_message * message)
extern

Borrows the stream of the discarded events message message (const version).

See bt_message_discarded_events_borrow_stream().

◆ bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const()

const bt_clock_snapshot * bt_message_discarded_events_borrow_beginning_default_clock_snapshot_const ( const bt_message * message)
extern

Borrows the beginning default clock snapshot of the discarded events message message.

See the beginning default clock snapshot property.

Parameters
[in]messageDiscarded events message from which to borrow the beginning default clock snapshot.
Returns
Beginning default clock snapshot of message.
Precondition
message is not NULL.
message is a discarded events message.
The discarded packets messages of the stream class of message have default clock snapshots.

◆ bt_message_discarded_events_borrow_end_default_clock_snapshot_const()

const bt_clock_snapshot * bt_message_discarded_events_borrow_end_default_clock_snapshot_const ( const bt_message * message)
extern

Borrows the end default clock snapshot of the discarded events message message.

See the end default clock snapshot property.

Parameters
[in]messageDiscarded events message from which to borrow the end default clock snapshot.
Returns
End default clock snapshot of message.
Precondition
message is not NULL.
message is a discarded events message.
The discarded packets messages of the stream class of message have default clock snapshots.

◆ bt_message_discarded_events_borrow_stream_class_default_clock_class_const()

const bt_clock_class * bt_message_discarded_events_borrow_stream_class_default_clock_class_const ( const bt_message * message)
extern

Borrows the default clock class of the stream class of the discarded events message message.

See the default clock class property of a stream class.

This is a helper which is equivalent to

const bt_stream * bt_message_discarded_events_borrow_stream_const(const bt_message *message)
Borrows the stream of the discarded events message message (const version).
Parameters
[in]messageDiscarded events message from which to borrow the default clock class of the class of its stream.
Returns
Borrowed reference of the default clock class of the stream class of message, or NULL if none.
Precondition
message is not NULL.
message is a discarded events message.

◆ bt_message_discarded_events_set_count()

void bt_message_discarded_events_set_count ( bt_message * message,
uint64_t count )
extern

Sets the number of discarded events of the discarded events message message to count.

See the discarded event count property.

Parameters
[in]messageDiscarded events message of which to set the number of discarded events to count.
[in]countNew number of discarded events of message.
Precondition
message is not NULL.
message is not frozen.
message is a discarded events message.
count > 0
See also
bt_message_discarded_events_get_count() — Returns the number of discarded events of a discarded events message.

◆ bt_message_discarded_events_get_count()

bt_property_availability bt_message_discarded_events_get_count ( const bt_message * message,
uint64_t * count )
extern

Returns the number of discarded events of the discarded events message message.

See the discarded event count property.

Parameters
[in]messageDiscarded events message of which to get the number of discarded events.
[out]countIf this function returns BT_PROPERTY_AVAILABILITY_AVAILABLE, then *count is the number of discarded events of message.
Return values
BT_PROPERTY_AVAILABILITY_AVAILABLEThe number of discarded events of message is available.
BT_PROPERTY_AVAILABILITY_NOT_AVAILABLEThe number of discarded events of message isn't available.
Precondition
message is not NULL.
message is a discarded events message.
count is not NULL.
See also
bt_message_discarded_events_set_count() — Sets the number of discarded events of a discarded events message.

◆ bt_message_discarded_packets_create()

bt_message * bt_message_discarded_packets_create ( bt_self_message_iterator * self_message_iterator,
const bt_stream * stream )
extern

Creates a discarded packets message for the stream stream from the message iterator self_message_iterator.

Attention

Only use this function if

bt_bool bt_stream_class_discarded_packets_have_default_clock_snapshots(const bt_stream_class *stream_class)
Returns whether or not the discarded packets messages of the instances (streams) of the stream class ...

returns BT_FALSE.

Otherwise, use bt_message_discarded_packets_create_with_default_clock_snapshots().

On success, the returned discarded packets message has the following property values:

Property Value
Stream stream
Beginning default clock snapshot None
End default clock snapshot None
Discarded packet count None
Parameters
[in]self_message_iteratorSelf message iterator from which to create the discarded packets message.
[in]streamStream from which the packets were discarded.
Returns
New discarded packets message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
stream is not NULL.
bt_stream_class_discarded_packets_have_default_clock_snapshots(bt_stream_borrow_class_const(stream)) returns BT_FALSE.
Postcondition
On success, stream is frozen.

◆ bt_message_discarded_packets_create_with_default_clock_snapshots()

bt_message * bt_message_discarded_packets_create_with_default_clock_snapshots ( bt_self_message_iterator * self_message_iterator,
const bt_stream * stream,
uint64_t beginning_clock_snapshot_value,
uint64_t end_clock_snapshot_value )
extern

Creates a discarded packets message having the beginning and end default clock snapshots with the values beginning_clock_snapshot_value and end_clock_snapshot_value for the stream stream from the message iterator self_message_iterator.

Attention

Only use this function if

returns BT_TRUE.

Otherwise, use bt_message_discarded_packets_create().

On success, the returned discarded packets message has the following property values:

Property Value
Stream stream
Beginning default clock snapshot Clock snapshot with the value beginning_clock_snapshot_value.
End default clock snapshot Clock snapshot with the value end_clock_snapshot_value.
Discarded packet count None
Parameters
[in]self_message_iteratorSelf message iterator from which to create the discarded packets message.
[in]streamStream from which the packets were discarded.
[in]beginning_clock_snapshot_valueValue (clock cycles) of the beginning default clock snapshot of message.
[in]end_clock_snapshot_valueValue (clock cycles) of the end default clock snapshot of message.
Returns
New discarded packets message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
stream is not NULL.
bt_stream_class_discarded_packets_have_default_clock_snapshots(bt_stream_borrow_class_const(stream)) returns BT_TRUE.
beginning_clock_snapshot_valueend_clock_snapshot_value
Postcondition
On success, stream is frozen.

◆ bt_message_discarded_packets_borrow_stream()

bt_stream * bt_message_discarded_packets_borrow_stream ( bt_message * message)
extern

Borrows the stream of the discarded packets message message.

See the stream property.

Parameters
[in]messageDiscarded packets message from which to borrow the stream.
Returns

Borrowed reference of the stream of message.

The returned pointer remains valid as long as message exists.

Precondition
message is not NULL.
message is a discarded packets message.
See also
bt_message_discarded_packets_borrow_stream_const()const version of this function.

◆ bt_message_discarded_packets_borrow_stream_const()

const bt_stream * bt_message_discarded_packets_borrow_stream_const ( const bt_message * message)
extern

Borrows the stream of the discarded packets message message (const version).

See bt_message_discarded_packets_borrow_stream().

◆ bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const()

const bt_clock_snapshot * bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const ( const bt_message * message)
extern

Borrows the beginning default clock snapshot of the discarded packets message message.

See the beginning default clock snapshot property.

Parameters
[in]messageDiscarded packets message from which to borrow the beginning default clock snapshot.
Returns
Beginning default clock snapshot of message.
Precondition
message is not NULL.
message is a discarded packets message.
The discarded packets messages of the stream class of message have default clock snapshots.

◆ bt_message_discarded_packets_borrow_end_default_clock_snapshot_const()

const bt_clock_snapshot * bt_message_discarded_packets_borrow_end_default_clock_snapshot_const ( const bt_message * message)
extern

Borrows the end default clock snapshot of the discarded packets message message.

See the end default clock snapshot property.

Parameters
[in]messageDiscarded packets message from which to borrow the end default clock snapshot.
Returns
End default clock snapshot of message.
Precondition
message is not NULL.
message is a discarded packets message.
The discarded packets messages of the stream class of message have default clock snapshots.

◆ bt_message_discarded_packets_borrow_stream_class_default_clock_class_const()

const bt_clock_class * bt_message_discarded_packets_borrow_stream_class_default_clock_class_const ( const bt_message * message)
extern

Borrows the default clock class of the stream class of the discarded packets message message.

See the default clock class property of a stream class.

This is a helper which is equivalent to

const bt_stream * bt_message_discarded_packets_borrow_stream_const(const bt_message *message)
Borrows the stream of the discarded packets message message (const version).
Parameters
[in]messageDiscarded packets message from which to borrow the default clock class of the class of its stream.
Returns
Borrowed reference of the default clock class of the stream class of message, or NULL if none.
Precondition
message is not NULL.
message is a discarded packets message.

◆ bt_message_discarded_packets_set_count()

void bt_message_discarded_packets_set_count ( bt_message * message,
uint64_t count )
extern

Sets the number of discarded packets of the discarded packets message message to count.

See the discarded packet count property.

Parameters
[in]messageDiscarded packets message of which to set the number of discarded packets to count.
[in]countNew number of discarded packets of message.
Precondition
message is not NULL.
message is not frozen.
message is a discarded packets message.
count > 0
See also
bt_message_discarded_packets_get_count() — Returns the number of discarded packets of a discarded packets message.

◆ bt_message_discarded_packets_get_count()

bt_property_availability bt_message_discarded_packets_get_count ( const bt_message * message,
uint64_t * count )
extern

Returns the number of discarded packets of the discarded packets message message.

See the discarded packet count property.

Parameters
[in]messageDiscarded packets message of which to get the number of discarded packets.
[out]countIf this function returns BT_PROPERTY_AVAILABILITY_AVAILABLE, then *count is the number of discarded packets of message.
Return values
BT_PROPERTY_AVAILABILITY_AVAILABLEThe number of discarded packets of message is available.
BT_PROPERTY_AVAILABILITY_NOT_AVAILABLEThe number of discarded packets of message isn't available.
Precondition
message is not NULL.
message is a discarded packets message.
count is not NULL.
See also
bt_message_discarded_packets_set_count() — Sets the number of discarded packets of a discarded packets message.

◆ bt_message_message_iterator_inactivity_create()

bt_message * bt_message_message_iterator_inactivity_create ( bt_self_message_iterator * self_message_iterator,
const bt_clock_class * clock_class,
uint64_t clock_snapshot_value )
extern

Creates a message iterator inactivity message having a clock snapshot of a fictitious instance of the clock class clock_class with the value clock_snapshot_value from the message iterator self_message_iterator.

On success, the returned message iterator inactivity message has the following property values:

Property Value
Clock snapshot Clock snapshot (snapshot of a fictitious instance of clock_class) with the value clock_snapshot_value.
Parameters
[in]self_message_iteratorSelf message iterator from which to create the message iterator inactivity message.
[in]clock_classClass of the fictitious instance of which clock_snapshot_value is the value of its snapshot.
[in]clock_snapshot_valueValue (clock cycles) of the clock snapshot of message.
Returns
New message iterator inactivity message reference, or NULL on memory error.
Precondition
self_message_iterator is not NULL.
clock_class is not NULL.
Postcondition
On success, clock_class is frozen.

◆ bt_message_message_iterator_inactivity_borrow_clock_snapshot_const()

const bt_clock_snapshot * bt_message_message_iterator_inactivity_borrow_clock_snapshot_const ( const bt_message * message)
extern

Borrows the clock snapshot of the message iterator inactivity message message.

See the clock snapshot property.

Parameters
[in]messageMessage iterator inactivity message from which to borrow the clock snapshot.
Returns
Clock snapshot of message.
Precondition
message is not NULL.
message is a message iterator inactivity message.

◆ bt_message_get_ref()

void bt_message_get_ref ( const bt_message * message)
extern

Increments the reference count of the message message.

Parameters
[in]message

Message of which to increment the reference count.

Can be NULL.

See also
bt_message_put_ref() — Decrements the reference count of a message.

◆ bt_message_put_ref()

void bt_message_put_ref ( const bt_message * message)
extern

Decrements the reference count of the message message.

Parameters
[in]message

Message of which to decrement the reference count.

Can be NULL.

See also
bt_message_get_ref() — Increments the reference count of a message.

◆ bt_get_greatest_operative_mip_version()

bt_get_greatest_operative_mip_version_status bt_get_greatest_operative_mip_version ( const bt_component_descriptor_set * component_descriptors,
bt_logging_level logging_level,
uint64_t * mip_version )
extern

Computes the greatest Message Interchange Protocol version which you can use to create a trace processing graph to which you intend to add components described by the component descriptors component_descriptors, and sets *mip_version to the result.

This function is equivalent to calling bt_get_greatest_operative_mip_version_with_restriction() with mip_version_restriction set to NULL (no restriction).

Parameters
[in]component_descriptorsComponent descriptors for which to get the supported MIP versions to compute the greatest operative MIP version.
[in]logging_levelLogging level to use when calling the "get supported MIP versions" method for each component descriptor in component_descriptors.
[out]mip_versionOn success, *mip_version is the greatest operative MIP version of all the component descriptors in component_descriptors.
Return values
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_OKSuccess.
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_NO_MATCHNo operative MIP version exists for the component descriptors of component_descriptors.
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_MEMORY_ERROROut of memory.
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_ERROROther error.
Precondition
component_descriptors is not NULL.
component_descriptors contains one or more component descriptors.
mip_version is not NULL.
See also
bt_get_greatest_operative_mip_version_with_restriction() — Computes the greatest MIP version for specific components with a MIP version restriction.

◆ bt_get_greatest_operative_mip_version_with_restriction()

enum bt_get_greatest_operative_mip_version_status bt_get_greatest_operative_mip_version_with_restriction ( const struct bt_component_descriptor_set * component_descriptors,
enum bt_logging_level logging_level,
const bt_integer_range_set_unsigned * mip_version_restriction,
uint64_t * mip_version )
extern

Computes the greatest Message Interchange Protocol version, restricted to the set of versions mip_version_restriction, which you can use to create a trace processing graph to which you intend to add components described by the component descriptors component_descriptors, and sets *mip_version to the result.

This function calls the "get supported MIP versions" method for each component descriptor in component_descriptors, and then sets *mip_version to the greatest common (operative) MIP version which is part of the set mip_version_restriction, if any. The "get supported MIP versions" method receives logging_level as its logging_level parameter.

For example, if all the components would support both MIP versions 0 and 1, but mip_version_restriction only contains the [0, 0] range, then this function sets *mip_version to 0.

If mip_version_restriction is NULL, then it's equivalent to the single range [0, 1], that is, all the possible MIP versions as of Babeltrace 2.0.

If this function doesn't find an operative MIP version within mip_version_restriction for the component descriptors of component_descriptors, then it returns BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_NO_MATCH.

Parameters
[in]component_descriptorsComponent descriptors for which to get the supported MIP versions to compute the greatest operative MIP version.
[in]logging_levelLogging level to use when calling the "get supported MIP versions" method for each component descriptor in component_descriptors.
[in]mip_version_restriction

Set of MIP versions of which *mip_version must be part of.

Can be NULL.

[out]mip_versionOn success, *mip_version is the greatest operative MIP version, within mip_version_restriction, of all the component descriptors in component_descriptors.
Return values
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_OKSuccess.
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_NO_MATCHNo operative MIP version exists within mip_version_restriction for the component descriptors of component_descriptors.
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_MEMORY_ERROROut of memory.
BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_ERROROther error.
Since
Babeltrace 2.1
Precondition
component_descriptors is not NULL.
component_descriptors contains one or more component descriptors.
If mip_version_restriction isn't NULL, then no upper value within the ranges of mip_version_restriction is greater than 1 (the return value of bt_get_maximal_mip_version()).
mip_version is not NULL.
See also
bt_get_greatest_operative_mip_version() — Computes the greatest MIP version for specific components.

◆ bt_get_maximal_mip_version()

uint64_t bt_get_maximal_mip_version ( void )
extern

Returns the maximal available Message Interchange Protocol version as of Babeltrace 2.0.

As of Babeltrace 2.0, this function returns 1.

Returns
Maximal available MIP version (1).