Babeltrace 2 C API  2.0.3
Open-source trace manipulation framework
 All Functions Variables Typedefs Enumerations Enumerator Modules Pages
message.h
1 #ifndef BABELTRACE2_GRAPH_MESSAGE_H
2 #define BABELTRACE2_GRAPH_MESSAGE_H
3 
4 /*
5  * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy
8  * of this software and associated documentation files (the "Software"), to deal
9  * in the Software without restriction, including without limitation the rights
10  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the Software is
12  * furnished to do so, subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in
15  * all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24  */
25 
26 #ifndef __BT_IN_BABELTRACE_H
27 # error "Please include <babeltrace2/babeltrace.h> instead."
28 #endif
29 
30 #include <babeltrace2/types.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
980 typedef enum bt_message_type {
986 
992 
998 
1004 
1010 
1016 
1022 
1028 } bt_message_type;
1029 
1042 extern bt_message_type bt_message_get_type(const bt_message *message);
1043 
1064 
1071 
1113 extern
1115  bt_self_message_iterator *self_message_iterator,
1116  const bt_stream *stream);
1117 
1141  bt_message *message);
1142 
1151  const bt_message *message);
1152 
1177 extern
1179  bt_message *message, uint64_t value);
1180 
1214  const bt_message *message,
1215  const bt_clock_snapshot **clock_snapshot);
1216 
1245 extern const bt_clock_class *
1247  const bt_message *message);
1248 
1290 extern
1292  bt_self_message_iterator *self_message_iterator,
1293  const bt_stream *stream);
1294 
1318  bt_message *message);
1319 
1328  const bt_message *message);
1329 
1354 extern
1356  bt_message *message, uint64_t value);
1357 
1391  const bt_message *message,
1392  const bt_clock_snapshot **clock_snapshot);
1393 
1422 extern const bt_clock_class *
1424  const bt_message *message);
1425 
1507 extern
1509  bt_self_message_iterator *self_message_iterator,
1510  const bt_event_class *event_class,
1511  const bt_stream *stream);
1512 
1591 extern
1593  bt_self_message_iterator *self_message_iterator,
1594  const bt_event_class *event_class,
1595  const bt_stream *stream, uint64_t clock_snapshot_value);
1596 
1676 extern
1678  bt_self_message_iterator *self_message_iterator,
1679  const bt_event_class *event_class,
1680  const bt_packet *packet);
1681 
1765 extern
1767  bt_self_message_iterator *self_message_iterator,
1768  const bt_event_class *event_class,
1769  const bt_packet *packet, uint64_t clock_snapshot_value);
1770 
1794  bt_message *message);
1795 
1804  const bt_message *message);
1805 
1824 extern const bt_clock_snapshot *
1826 
1856 extern const bt_clock_class *
1858  const bt_message *message);
1859 
1923 extern
1925  bt_self_message_iterator *self_message_iterator,
1926  const bt_packet *packet);
1927 
1988 extern
1990  bt_self_message_iterator *self_message_iterator,
1991  const bt_packet *packet, uint64_t clock_snapshot_value);
1992 
2016  bt_message *message);
2017 
2026  const bt_message *message);
2027 
2047 extern const bt_clock_snapshot *
2049  const bt_message *message);
2050 
2080 extern const bt_clock_class *
2082  const bt_message *message);
2083 
2146 extern
2148  bt_self_message_iterator *self_message_iterator,
2149  const bt_packet *packet);
2150 
2211 extern
2213  bt_self_message_iterator *self_message_iterator,
2214  const bt_packet *packet, uint64_t clock_snapshot_value);
2215 
2239  bt_message *message);
2240 
2249  const bt_message *message);
2250 
2270 extern const bt_clock_snapshot *
2272  const bt_message *message);
2273 
2303 extern const bt_clock_class *
2305  const bt_message *message);
2306 
2373  bt_self_message_iterator *self_message_iterator,
2374  const bt_stream *stream);
2375 
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 
2471  bt_message *message);
2472 
2480 extern const bt_stream *
2482 
2506 extern const bt_clock_snapshot *
2508  const bt_message *message);
2509 
2533 extern const bt_clock_snapshot *
2535  const bt_message *message);
2536 
2565 extern const bt_clock_class *
2567  const bt_message *message);
2568 
2592  uint64_t count);
2593 
2623  const bt_message *message, uint64_t *count);
2624 
2691  bt_self_message_iterator *self_message_iterator,
2692  const bt_stream *stream);
2693 
2761  bt_self_message_iterator *self_message_iterator,
2762  const bt_stream *stream, uint64_t beginning_clock_snapshot_value,
2763  uint64_t end_clock_snapshot_value);
2764 
2788  bt_message *message);
2789 
2797 extern const bt_stream *
2799 
2823 extern const bt_clock_snapshot *
2825  const bt_message *message);
2826 
2850 extern const bt_clock_snapshot *
2852  const bt_message *message);
2853 
2882 extern const bt_clock_class *
2884  const bt_message *message);
2885 
2909  uint64_t count);
2910 
2940  const bt_message *message, uint64_t *count);
2941 
2988 extern
2990  bt_self_message_iterator *self_message_iterator,
2991  const bt_clock_class *clock_class,
2992  uint64_t clock_snapshot_value);
2993 
3010 extern const bt_clock_snapshot *
3012  const bt_message *message);
3013 
3036 extern void bt_message_get_ref(const bt_message *message);
3037 
3053 extern void bt_message_put_ref(const bt_message *message);
3054 
3069 #define BT_MESSAGE_PUT_REF_AND_RESET(_message) \
3070  do { \
3071  bt_message_put_ref(_message); \
3072  (_message) = NULL; \
3073  } while (0)
3074 
3100 #define BT_MESSAGE_MOVE_REF(_dst, _src) \
3101  do { \
3102  bt_message_put_ref(_dst); \
3103  (_dst) = (_src); \
3104  (_src) = NULL; \
3105  } while (0)
3106 
3125 
3131 
3137 
3144 
3199  const bt_component_descriptor_set *component_descriptors,
3200  bt_logging_level logging_level, uint64_t *mip_version);
3201 
3213 extern uint64_t bt_get_maximal_mip_version(void);
3214 
3219 #ifdef __cplusplus
3220 }
3221 #endif
3222 
3223 #endif /* BABELTRACE2_GRAPH_MESSAGE_H */
struct bt_component_descriptor_set bt_component_descriptor_set
Component descriptor set.
Definition: types.h:43
bt_stream * bt_message_discarded_events_borrow_stream(bt_message *message)
Borrows the stream of the discarded events message message.
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:1009
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:100
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:997
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:1027
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:3136
struct bt_event bt_event
Event.
Definition: types.h:50
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:980
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:985
bt_property_availability
Availability of an object's property.
Definition: types.h:173
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:71
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:1003
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:103
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:991
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:1058
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:3124
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:1021
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:1063
bt_get_greatest_operative_mip_version_status
Status codes for bt_get_greatest_operative_mip_version().
Definition: message.h:3119
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:110
Unknown (no) clock snapshot.
Definition: message.h:1069
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:51
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:3142
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:37
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:1015
No match found.
Definition: message.h:3130
uint64_t bt_get_maximal_mip_version(void)
Returns the maximal available Message Interchange Protocol version as of Babeltrace 2.0.
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:75
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:36