Babeltrace 2 C API  2.1.1
Open-source trace manipulation framework
message.h
1 /*
2  * SPDX-License-Identifier: MIT
3  *
4  * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
5  */
6 
7 #ifndef BABELTRACE2_GRAPH_MESSAGE_H
8 #define BABELTRACE2_GRAPH_MESSAGE_H
9 
10 /* IWYU pragma: private, include <babeltrace2/babeltrace.h> */
11 
12 #ifndef __BT_IN_BABELTRACE_H
13 # error "Please include <babeltrace2/babeltrace.h> instead."
14 #endif
15 
16 #include <babeltrace2/types.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
976 typedef enum bt_message_type {
982 
988 
994 
1000 
1006 
1012 
1018 
1024 } bt_message_type;
1025 
1038 extern bt_message_type bt_message_get_type(const bt_message *message)
1039  __BT_NOEXCEPT;
1040 
1061 
1068 
1110 extern
1112  bt_self_message_iterator *self_message_iterator,
1113  const bt_stream *stream) __BT_NOEXCEPT;
1114 
1138  bt_message *message) __BT_NOEXCEPT;
1139 
1148  const bt_message *message) __BT_NOEXCEPT;
1149 
1174 extern
1176  bt_message *message, uint64_t value) __BT_NOEXCEPT;
1177 
1211  const bt_message *message,
1212  const bt_clock_snapshot **clock_snapshot) __BT_NOEXCEPT;
1213 
1241 extern const bt_clock_class *
1243  const bt_message *message) __BT_NOEXCEPT;
1244 
1286 extern
1288  bt_self_message_iterator *self_message_iterator,
1289  const bt_stream *stream) __BT_NOEXCEPT;
1290 
1314  bt_message *message) __BT_NOEXCEPT;
1315 
1324  const bt_message *message) __BT_NOEXCEPT;
1325 
1350 extern
1352  bt_message *message, uint64_t value) __BT_NOEXCEPT;
1353 
1387  const bt_message *message,
1388  const bt_clock_snapshot **clock_snapshot) __BT_NOEXCEPT;
1389 
1418 extern const bt_clock_class *
1420  const bt_message *message) __BT_NOEXCEPT;
1421 
1503 extern
1505  bt_self_message_iterator *self_message_iterator,
1506  const bt_event_class *event_class,
1507  const bt_stream *stream) __BT_NOEXCEPT;
1508 
1587 extern
1589  bt_self_message_iterator *self_message_iterator,
1590  const bt_event_class *event_class,
1591  const bt_stream *stream, uint64_t clock_snapshot_value)
1592  __BT_NOEXCEPT;
1593 
1673 extern
1675  bt_self_message_iterator *self_message_iterator,
1676  const bt_event_class *event_class,
1677  const bt_packet *packet) __BT_NOEXCEPT;
1678 
1762 extern
1764  bt_self_message_iterator *self_message_iterator,
1765  const bt_event_class *event_class,
1766  const bt_packet *packet, uint64_t clock_snapshot_value)
1767  __BT_NOEXCEPT;
1768 
1792  __BT_NOEXCEPT;
1793 
1802  const bt_message *message) __BT_NOEXCEPT;
1803 
1822 extern const bt_clock_snapshot *
1824  __BT_NOEXCEPT;
1825 
1854 extern const bt_clock_class *
1856  const bt_message *message) __BT_NOEXCEPT;
1857 
1921 extern
1923  bt_self_message_iterator *self_message_iterator,
1924  const bt_packet *packet) __BT_NOEXCEPT;
1925 
1986 extern
1988  bt_self_message_iterator *self_message_iterator,
1989  const bt_packet *packet, uint64_t clock_snapshot_value)
1990  __BT_NOEXCEPT;
1991 
2015  bt_message *message) __BT_NOEXCEPT;
2016 
2025  const bt_message *message) __BT_NOEXCEPT;
2026 
2046 extern const bt_clock_snapshot *
2048  const bt_message *message) __BT_NOEXCEPT;
2049 
2078 extern const bt_clock_class *
2080  const bt_message *message) __BT_NOEXCEPT;
2081 
2144 extern
2146  bt_self_message_iterator *self_message_iterator,
2147  const bt_packet *packet) __BT_NOEXCEPT;
2148 
2209 extern
2211  bt_self_message_iterator *self_message_iterator,
2212  const bt_packet *packet, uint64_t clock_snapshot_value)
2213  __BT_NOEXCEPT;
2214 
2238  bt_message *message) __BT_NOEXCEPT;
2239 
2248  const bt_message *message) __BT_NOEXCEPT;
2249 
2269 extern const bt_clock_snapshot *
2271  const bt_message *message) __BT_NOEXCEPT;
2272 
2301 extern const bt_clock_class *
2303  const bt_message *message) __BT_NOEXCEPT;
2304 
2371  bt_self_message_iterator *self_message_iterator,
2372  const bt_stream *stream) __BT_NOEXCEPT;
2373 
2443  bt_self_message_iterator *self_message_iterator,
2444  const bt_stream *stream,
2445  uint64_t beginning_clock_snapshot_value,
2446  uint64_t end_clock_snapshot_value)
2447  __BT_NOEXCEPT;
2448 
2472  bt_message *message) __BT_NOEXCEPT;
2473 
2481 extern const bt_stream *
2483  __BT_NOEXCEPT;
2484 
2508 extern const bt_clock_snapshot *
2510  const bt_message *message) __BT_NOEXCEPT;
2511 
2535 extern const bt_clock_snapshot *
2537  const bt_message *message) __BT_NOEXCEPT;
2538 
2566 extern const bt_clock_class *
2568  const bt_message *message) __BT_NOEXCEPT;
2569 
2595  uint64_t count) __BT_NOEXCEPT;
2596 
2626  const bt_message *message, uint64_t *count) __BT_NOEXCEPT;
2627 
2694  bt_self_message_iterator *self_message_iterator,
2695  const bt_stream *stream) __BT_NOEXCEPT;
2696 
2766  bt_self_message_iterator *self_message_iterator,
2767  const bt_stream *stream, uint64_t beginning_clock_snapshot_value,
2768  uint64_t end_clock_snapshot_value) __BT_NOEXCEPT;
2769 
2793  bt_message *message) __BT_NOEXCEPT;
2794 
2802 extern const bt_stream *
2804  __BT_NOEXCEPT;
2805 
2829 extern const bt_clock_snapshot *
2831  const bt_message *message) __BT_NOEXCEPT;
2832 
2856 extern const bt_clock_snapshot *
2858  const bt_message *message) __BT_NOEXCEPT;
2859 
2887 extern const bt_clock_class *
2889  const bt_message *message) __BT_NOEXCEPT;
2890 
2916  uint64_t count) __BT_NOEXCEPT;
2917 
2947  const bt_message *message, uint64_t *count) __BT_NOEXCEPT;
2948 
2995 extern
2997  bt_self_message_iterator *self_message_iterator,
2998  const bt_clock_class *clock_class,
2999  uint64_t clock_snapshot_value) __BT_NOEXCEPT;
3000 
3017 extern const bt_clock_snapshot *
3019  const bt_message *message) __BT_NOEXCEPT;
3020 
3043 extern void bt_message_get_ref(const bt_message *message) __BT_NOEXCEPT;
3044 
3060 extern void bt_message_put_ref(const bt_message *message) __BT_NOEXCEPT;
3061 
3076 #define BT_MESSAGE_PUT_REF_AND_RESET(_message) \
3077  do { \
3078  bt_message_put_ref(_message); \
3079  (_message) = NULL; \
3080  } while (0)
3081 
3107 #define BT_MESSAGE_MOVE_REF(_dst, _src) \
3108  do { \
3109  bt_message_put_ref(_dst); \
3110  (_dst) = (_src); \
3111  (_src) = NULL; \
3112  } while (0)
3113 
3132 
3138 
3144 
3151 
3198  const bt_component_descriptor_set *component_descriptors,
3199  bt_logging_level logging_level, uint64_t *mip_version)
3200  __BT_NOEXCEPT;
3201 
3282  const struct bt_component_descriptor_set *component_descriptors,
3283  enum bt_logging_level logging_level,
3284  const bt_integer_range_set_unsigned *mip_version_restriction,
3285  uint64_t *mip_version)
3286  __BT_NOEXCEPT;
3287 
3299 extern uint64_t bt_get_maximal_mip_version(void) __BT_NOEXCEPT;
3300 
3305 #ifdef __cplusplus
3306 }
3307 #endif
3308 
3309 #endif /* BABELTRACE2_GRAPH_MESSAGE_H */
struct bt_component_descriptor_set bt_component_descriptor_set
Component descriptor set.
Definition: types.h:29
bt_stream * bt_message_discarded_events_borrow_stream(bt_message *message)
Borrows the stream of the discarded events message message.
struct bt_integer_range_set_unsigned bt_integer_range_set_unsigned
Set of unsigned 64-bit integer ranges.
Definition: types.h:54
const bt_clock_class * bt_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.
Packet end message.
Definition: message.h:1005
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_packet * bt_message_packet_end_borrow_packet_const(const bt_message *message)
Borrows the packet of the packet end message message (const version).
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)
Creates a message iterator inactivity message having a clock snapshot of a fictitious instance of the...
struct bt_self_message_iterator bt_self_message_iterator
Self message iterator.
Definition: types.h:86
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)
Creates a packet end message having a default clock snapshot with the value clock_snapshot_value for ...
bt_event * bt_message_event_borrow_event(bt_message *message)
Borrows the event of the event message message.
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)
Creates a packet beginning message having a default clock snapshot with the value clock_snapshot_valu...
bt_message * bt_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_itera...
Event message.
Definition: message.h:993
bt_packet * bt_message_packet_end_borrow_packet(bt_message *message)
Borrows the packet of the packet end message message.
Message iterator inactivity message.
Definition: message.h:1023
void bt_message_put_ref(const bt_message *message)
Decrements the reference count of the message message.
const bt_clock_snapshot * bt_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_class * bt_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...
Out of memory.
Definition: message.h:3143
struct bt_event bt_event
Event.
Definition: types.h:36
bt_stream * bt_message_stream_beginning_borrow_stream(bt_message *message)
Borrows the stream of the stream beginning message message.
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.
bt_message_type
Message type enumerators.
Definition: message.h:976
bt_message_type bt_message_get_type(const bt_message *message)
Returns the type enumerator of the message message.
Stream beginning message.
Definition: message.h:981
bt_property_availability
Availability of an object property.
Definition: types.h:159
const bt_clock_snapshot * bt_message_message_iterator_inactivity_borrow_clock_snapshot_const(const bt_message *message)
Borrows the clock snapshot of the message iterator inactivity message message.
struct bt_message bt_message
Message.
Definition: types.h:58
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.
Packet beginning message.
Definition: message.h:999
const bt_clock_class * bt_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...
bt_packet * bt_message_packet_beginning_borrow_packet(bt_message *message)
Borrows the packet of the packet beginning message message.
struct bt_stream bt_stream
Stream.
Definition: types.h:89
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.
Stream end message.
Definition: message.h:987
const bt_clock_snapshot * bt_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.
bt_message_stream_clock_snapshot_state
Return type of bt_message_stream_beginning_borrow_default_clock_snapshot_const() and bt_message_strea...
Definition: message.h:1055
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 proces...
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)
Creates an event message, having an instance of the event class event_class and a default clock snaps...
Success.
Definition: message.h:3131
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.
const bt_clock_snapshot * bt_message_event_borrow_default_clock_snapshot_const(const bt_message *message)
Borrows the default clock snapshot of the event message message.
const bt_clock_class * bt_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...
Discarded packets message.
Definition: message.h:1017
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).
Known clock snapshot.
Definition: message.h:1060
bt_get_greatest_operative_mip_version_status
Status codes for bt_get_greatest_operative_mip_version() and bt_get_greatest_operative_mip_version_wi...
Definition: message.h:3126
void bt_message_get_ref(const bt_message *message)
Increments the reference count of the message message.
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).
bt_logging_level
Logging level enumerators.
Definition: logging.h:97
Unknown (no) clock snapshot.
Definition: message.h:1066
bt_message * bt_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_iter...
struct bt_event_class bt_event_class
Event class.
Definition: types.h:37
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)
Creates an event message, having an instance of the event class event_class, for the packet packet fr...
bt_message * bt_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_itera...
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 v...
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)
Creates an event message, having an instance of the event class event_class and a default clock snaps...
const bt_clock_snapshot * bt_message_packet_beginning_borrow_default_clock_snapshot_const(const bt_message *message)
Borrows the default clock snapshot of the packet beginning message message.
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)
Creates a discarded events message having the beginning and end default clock snapshots with the valu...
const bt_clock_class * bt_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. ...
const bt_clock_class * bt_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...
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_snapshot * bt_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.
bt_message * bt_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 fr...
const bt_clock_snapshot * bt_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_stream * bt_message_discarded_events_borrow_stream_const(const bt_message *message)
Borrows the stream of the discarded events message message (const version).
Other error.
Definition: message.h:3149
bt_message * bt_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.
struct bt_clock_snapshot bt_clock_snapshot
Clock snapshot.
Definition: types.h:23
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_ver...
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. ...
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).
Discarded events message.
Definition: message.h:1011
No match found.
Definition: message.h:3137
uint64_t bt_get_maximal_mip_version(void)
Returns the maximal available Message Interchange Protocol version as of Babeltrace 2.1.
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 messag...
struct bt_packet bt_packet
Packet.
Definition: types.h:62
bt_message * bt_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_itera...
bt_message * bt_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_stream * bt_message_stream_end_borrow_stream(bt_message *message)
Borrows the stream of the stream end message message.
bt_stream * bt_message_discarded_packets_borrow_stream(bt_message *message)
Borrows the stream of the discarded packets message message.
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).
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)
Creates a discarded packets message having the beginning and end default clock snapshots with the val...
const bt_clock_class * bt_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.
const bt_clock_snapshot * bt_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.
struct bt_clock_class bt_clock_class
Clock class.
Definition: types.h:22