Commit | Line | Data |
---|---|---|
56e18c4c PP |
1 | #ifndef BABELTRACE_TRACE_IR_PACKET_H |
2 | #define BABELTRACE_TRACE_IR_PACKET_H | |
f79cf0f0 PP |
3 | |
4 | /* | |
56e18c4c | 5 | * BabelTrace - Trace IR: Stream packet |
f79cf0f0 PP |
6 | * |
7 | * Copyright 2016 Philippe Proulx <pproulx@efficios.com> | |
8 | * | |
9 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | * of this software and associated documentation files (the "Software"), to deal | |
11 | * in the Software without restriction, including without limitation the rights | |
12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
13 | * copies of the Software, and to permit persons to whom the Software is | |
14 | * furnished to do so, subject to the following conditions: | |
15 | * | |
16 | * The above copyright notice and this permission notice shall be included in | |
17 | * all copies or substantial portions of the Software. | |
18 | * | |
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
25 | * SOFTWARE. | |
26 | * | |
27 | * The Common Trace Format (CTF) Specification is available at | |
28 | * http://www.efficios.com/ctf | |
29 | */ | |
30 | ||
e22b45d0 PP |
31 | #include <stdint.h> |
32 | ||
44c440bc PP |
33 | /* For enum bt_property_availability */ |
34 | #include <babeltrace/property.h> | |
094ff7c0 | 35 | |
44c440bc | 36 | /* For enum bt_clock_value_status */ |
56e18c4c | 37 | #include <babeltrace/trace-ir/clock-value.h> |
f79cf0f0 PP |
38 | |
39 | #ifdef __cplusplus | |
40 | extern "C" { | |
41 | #endif | |
42 | ||
50842bdc | 43 | struct bt_packet; |
312c056a PP |
44 | struct bt_packet_header_field; |
45 | struct bt_packet_context_field; | |
50842bdc | 46 | struct bt_stream; |
e22b45d0 | 47 | struct bt_clock_value; |
f79cf0f0 | 48 | |
44c440bc | 49 | extern struct bt_packet *bt_packet_create(struct bt_stream *stream); |
f5efa812 | 50 | |
44c440bc | 51 | extern struct bt_stream *bt_packet_borrow_stream(struct bt_packet *packet); |
f5efa812 | 52 | |
094ff7c0 | 53 | extern |
44c440bc | 54 | struct bt_field *bt_packet_borrow_header_field(struct bt_packet *packet); |
094ff7c0 | 55 | |
312c056a | 56 | extern |
44c440bc | 57 | int bt_packet_move_header_field(struct bt_packet *packet, |
312c056a | 58 | struct bt_packet_header_field *header); |
f5efa812 | 59 | |
312c056a | 60 | extern |
44c440bc | 61 | struct bt_field *bt_packet_borrow_context_field(struct bt_packet *packet); |
f5efa812 | 62 | |
312c056a | 63 | extern |
44c440bc | 64 | int bt_packet_move_context_field(struct bt_packet *packet, |
312c056a | 65 | struct bt_packet_context_field *context); |
f79cf0f0 | 66 | |
ccf82993 | 67 | extern |
44c440bc PP |
68 | enum bt_clock_value_status bt_packet_borrow_default_beginning_clock_value( |
69 | struct bt_packet *packet, struct bt_clock_value **clock_value); | |
e22b45d0 | 70 | |
ccf82993 | 71 | extern |
44c440bc PP |
72 | int bt_packet_set_default_beginning_clock_value(struct bt_packet *packet, |
73 | uint64_t value_cycles); | |
e22b45d0 | 74 | |
ccf82993 | 75 | extern |
44c440bc | 76 | enum bt_clock_value_status bt_packet_borrow_default_end_clock_valeu( |
ccf82993 PP |
77 | struct bt_packet *packet, struct bt_clock_value **clock_value); |
78 | ||
79 | extern | |
44c440bc PP |
80 | int bt_packet_set_default_end_clock_value(struct bt_packet *packet, |
81 | uint64_t value_cycles); | |
ccf82993 PP |
82 | |
83 | extern | |
44c440bc PP |
84 | enum bt_property_availability bt_packet_get_discarded_event_counter_snapshot( |
85 | struct bt_packet *packet, uint64_t *value); | |
ccf82993 PP |
86 | |
87 | extern | |
44c440bc PP |
88 | int bt_packet_set_discarded_event_counter_snapshot(struct bt_packet *packet, |
89 | uint64_t value); | |
ccf82993 PP |
90 | |
91 | extern | |
44c440bc PP |
92 | enum bt_property_availability bt_packet_get_packet_counter_snapshot( |
93 | struct bt_packet *packet, uint64_t *value); | |
e22b45d0 | 94 | |
44c440bc PP |
95 | extern |
96 | int bt_packet_set_packet_counter_snapshot(struct bt_packet *packet, | |
97 | uint64_t value); | |
a0491f93 | 98 | |
f79cf0f0 PP |
99 | #ifdef __cplusplus |
100 | } | |
101 | #endif | |
102 | ||
56e18c4c | 103 | #endif /* BABELTRACE_TRACE_IR_PACKET_H */ |