Babeltrace 2 C API 2.0.6
Open-source trace manipulation framework
Loading...
Searching...
No Matches
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
33extern "C" {
34#endif
35
1029
1043
1071
1113extern
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
1177extern
1179 bt_message *message, uint64_t value);
1180
1214 const bt_message *message,
1215 const bt_clock_snapshot **clock_snapshot);
1216
1245extern const bt_clock_class *
1247 const bt_message *message);
1248
1290extern
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
1354extern
1356 bt_message *message, uint64_t value);
1357
1391 const bt_message *message,
1392 const bt_clock_snapshot **clock_snapshot);
1393
1422extern const bt_clock_class *
1424 const bt_message *message);
1425
1507extern
1509 bt_self_message_iterator *self_message_iterator,
1510 const bt_event_class *event_class,
1511 const bt_stream *stream);
1512
1591extern
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
1676extern
1678 bt_self_message_iterator *self_message_iterator,
1679 const bt_event_class *event_class,
1680 const bt_packet *packet);
1681
1765extern
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
1824extern const bt_clock_snapshot *
1826
1856extern const bt_clock_class *
1858 const bt_message *message);
1859
1923extern
1925 bt_self_message_iterator *self_message_iterator,
1926 const bt_packet *packet);
1927
1988extern
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
2047extern const bt_clock_snapshot *
2049 const bt_message *message);
2050
2080extern const bt_clock_class *
2082 const bt_message *message);
2083
2146extern
2148 bt_self_message_iterator *self_message_iterator,
2149 const bt_packet *packet);
2150
2211extern
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
2270extern const bt_clock_snapshot *
2272 const bt_message *message);
2273
2303extern 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
2480extern const bt_stream *
2482
2506extern const bt_clock_snapshot *
2508 const bt_message *message);
2509
2533extern const bt_clock_snapshot *
2535 const bt_message *message);
2536
2565extern 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
2797extern const bt_stream *
2799
2823extern const bt_clock_snapshot *
2825 const bt_message *message);
2826
2850extern const bt_clock_snapshot *
2852 const bt_message *message);
2853
2882extern const bt_clock_class *
2884 const bt_message *message);
2885
2909 uint64_t count);
2910
2940 const bt_message *message, uint64_t *count);
2941
2988extern
2990 bt_self_message_iterator *self_message_iterator,
2991 const bt_clock_class *clock_class,
2992 uint64_t clock_snapshot_value);
2993
3010extern const bt_clock_snapshot *
3012 const bt_message *message);
3013
3036extern void bt_message_get_ref(const bt_message *message);
3037
3053extern 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
3144
3199 const bt_component_descriptor_set *component_descriptors,
3200 bt_logging_level logging_level, uint64_t *mip_version);
3201
3213extern uint64_t bt_get_maximal_mip_version(void);
3214
3219#ifdef __cplusplus
3220}
3221#endif
3222
3223#endif /* BABELTRACE2_GRAPH_MESSAGE_H */
bt_property_availability
Availability of an object's property.
Definition types.h:173
struct bt_component_descriptor_set bt_component_descriptor_set
Component descriptor set.
Definition types.h:43
bt_logging_level
Logging level enumerators.
Definition logging.h:110
struct bt_message bt_message
Message.
Definition types.h:71
bt_stream * bt_message_stream_beginning_borrow_stream(bt_message *message)
Borrows the stream of the stream beginning message message.
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...
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.
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_stream * bt_message_discarded_events_borrow_stream(bt_message *message)
Borrows the stream of the discarded events message message.
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.
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_message_stream_beginning_borrow_stream_const(const bt_message *message)
Borrows the stream of the stream beginning message message (const version).
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_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 * 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...
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.
bt_message_type bt_message_get_type(const bt_message *message)
Returns the type enumerator of the message message.
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...
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.
bt_packet * bt_message_packet_beginning_borrow_packet(bt_message *message)
Borrows the packet of the packet beginning message message.
bt_message_type
Message type enumerators.
Definition message.h:980
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_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_packet * bt_message_packet_end_borrow_packet(bt_message *message)
Borrows the packet of the packet end message message.
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_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
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.
uint64_t bt_get_maximal_mip_version(void)
Returns the maximal available Message Interchange Protocol version as of Babeltrace&#160;2....
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).
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_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_packet * bt_message_packet_end_borrow_packet_const(const bt_message *message)
Borrows the packet of the packet end message message (const version).
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_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...
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...
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...
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_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.
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...
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...
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_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_packet * bt_message_packet_beginning_borrow_packet_const(const bt_message *message)
Borrows the packet of the packet beginning message message (const version).
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...
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).
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.
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...
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_stream * bt_message_discarded_packets_borrow_stream(bt_message *message)
Borrows the stream of the discarded packets message message.
bt_get_greatest_operative_mip_version_status
Status codes for bt_get_greatest_operative_mip_version().
Definition message.h:3119
bt_event * bt_message_event_borrow_event(bt_message *message)
Borrows the event of the event 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_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...
bt_stream * bt_message_stream_end_borrow_stream(bt_message *message)
Borrows the stream of the stream end message message.
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...
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.
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).
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.
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...
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.
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.
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.
@ BT_MESSAGE_TYPE_EVENT
Event message.
Definition message.h:997
@ BT_MESSAGE_TYPE_STREAM_BEGINNING
Stream beginning message.
Definition message.h:985
@ BT_MESSAGE_TYPE_PACKET_BEGINNING
Packet beginning message.
Definition message.h:1003
@ BT_MESSAGE_TYPE_PACKET_END
Packet end message.
Definition message.h:1009
@ BT_MESSAGE_TYPE_DISCARDED_PACKETS
Discarded packets message.
Definition message.h:1021
@ BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY
Message iterator inactivity message.
Definition message.h:1027
@ BT_MESSAGE_TYPE_STREAM_END
Stream end message.
Definition message.h:991
@ BT_MESSAGE_TYPE_DISCARDED_EVENTS
Discarded events message.
Definition message.h:1015
@ BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_KNOWN
Known clock snapshot.
Definition message.h:1063
@ BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_UNKNOWN
Unknown (no) clock snapshot.
Definition message.h:1069
@ BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_OK
Success.
Definition message.h:3124
@ BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_NO_MATCH
No match found.
Definition message.h:3130
@ BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_MEMORY_ERROR
Out of memory.
Definition message.h:3136
@ BT_GET_GREATEST_OPERATIVE_MIP_VERSION_STATUS_ERROR
Other error.
Definition message.h:3142
struct bt_self_message_iterator bt_self_message_iterator
Self message iterator.
Definition types.h:100
struct bt_clock_class bt_clock_class
Clock class.
Definition types.h:36
struct bt_clock_snapshot bt_clock_snapshot
Clock snapshot.
Definition types.h:37
struct bt_event_class bt_event_class
Event class.
Definition types.h:51
struct bt_event bt_event
Event.
Definition types.h:50
struct bt_packet bt_packet
Packet.
Definition types.h:75
struct bt_stream bt_stream
Stream.
Definition types.h:103