Babeltrace 2 C API  2.0.3
Open-source trace manipulation framework
 All Functions Variables Typedefs Enumerations Enumerator Modules Pages
stream-class.h
1 #ifndef BABELTRACE2_TRACE_IR_STREAM_CLASS_H
2 #define BABELTRACE2_TRACE_IR_STREAM_CLASS_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 <stdint.h>
31 
32 #include <babeltrace2/types.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
578  bt_trace_class *trace_class);
579 
675  bt_trace_class *trace_class, uint64_t id);
676 
701  bt_stream_class *stream_class);
702 
711  const bt_stream_class *stream_class);
712 
734  const bt_stream_class *stream_class);
735 
767 extern bt_event_class *
769  bt_stream_class *stream_class, uint64_t index);
770 
778 extern const bt_event_class *
780  const bt_stream_class *stream_class, uint64_t index);
781 
811 extern bt_event_class *
813  bt_stream_class *stream_class, uint64_t id);
814 
822 extern const bt_event_class *
824  const bt_stream_class *stream_class, uint64_t id);
825 
851 extern uint64_t bt_stream_class_get_id(
852  const bt_stream_class *stream_class);
853 
863  BT_STREAM_CLASS_SET_NAME_STATUS_OK = __BT_FUNC_STATUS_OK,
864 
869  BT_STREAM_CLASS_SET_NAME_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR,
871 
897  bt_stream_class *stream_class, const char *name);
898 
923 extern const char *bt_stream_class_get_name(
924  const bt_stream_class *stream_class);
925 
937 
966  bt_stream_class *stream_class,
967  bt_clock_class *clock_class);
968 
995  bt_stream_class *stream_class);
996 
1004 extern const bt_clock_class *
1006  const bt_stream_class *stream_class);
1007 
1019 
1026 
1080  bt_stream_class *stream_class,
1081  bt_field_class *field_class);
1082 
1108 extern bt_field_class *
1110  bt_stream_class *stream_class);
1111 
1119 extern const bt_field_class *
1121  const bt_stream_class *stream_class);
1122 
1165  bt_stream_class *stream_class,
1166  bt_field_class *field_class);
1167 
1195 extern bt_field_class *
1197  bt_stream_class *stream_class);
1198 
1206 extern const bt_field_class *
1208  const bt_stream_class *stream_class);
1209 
1234  bt_stream_class *stream_class,
1235  bt_bool assigns_automatic_event_class_id);
1236 
1261  const bt_stream_class *stream_class);
1262 
1287  bt_stream_class *stream_class, bt_bool assigns_automatic_stream_id);
1288 
1312  const bt_stream_class *stream_class);
1313 
1366  bt_stream_class *stream_class, bt_bool supports_packets,
1367  bt_bool with_beginning_default_clock_snapshot,
1368  bt_bool with_end_default_clock_snapshot);
1369 
1391  const bt_stream_class *stream_class);
1392 
1420  const bt_stream_class *stream_class);
1421 
1449  const bt_stream_class *stream_class);
1450 
1493  bt_stream_class *stream_class,
1494  bt_bool supports_discarded_events,
1495  bt_bool with_default_clock_snapshots);
1496 
1521  const bt_stream_class *stream_class);
1522 
1548  const bt_stream_class *stream_class);
1549 
1598  bt_stream_class *stream_class,
1599  bt_bool supports_discarded_packets,
1600  bt_bool with_default_clock_snapshots);
1601 
1626  const bt_stream_class *stream_class);
1627 
1653  const bt_stream_class *stream_class);
1654 
1685  bt_stream_class *stream_class, const bt_value *user_attributes);
1686 
1713  bt_stream_class *stream_class);
1714 
1723  const bt_stream_class *stream_class);
1724 
1747 extern void bt_stream_class_get_ref(const bt_stream_class *stream_class);
1748 
1764 extern void bt_stream_class_put_ref(const bt_stream_class *stream_class);
1765 
1780 #define BT_STREAM_CLASS_PUT_REF_AND_RESET(_stream_class) \
1781  do { \
1782  bt_stream_class_put_ref(_stream_class); \
1783  (_stream_class) = NULL; \
1784  } while (0)
1785 
1811 #define BT_STREAM_CLASS_MOVE_REF(_dst, _src) \
1812  do { \
1813  bt_stream_class_put_ref(_dst); \
1814  (_dst) = (_src); \
1815  (_src) = NULL; \
1816  } while (0)
1817 
1822 #ifdef __cplusplus
1823 }
1824 #endif
1825 
1826 #endif /* BABELTRACE2_TRACE_IR_STREAM_CLASS_H */
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 ...
Out of memory.
Definition: stream-class.h:1024
const bt_trace_class * bt_stream_class_borrow_trace_class_const(const bt_stream_class *stream_class)
Borrows the trace class which contains the stream class stream_class (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).
void bt_stream_class_set_assigns_automatic_stream_id(bt_stream_class *stream_class, bt_bool assigns_automatic_stream_id)
Sets whether or not the stream class stream_class automatically assigns a numeric ID to a stream you ...
void bt_stream_class_set_user_attributes(bt_stream_class *stream_class, const bt_value *user_attributes)
Sets the user attributes of the stream class stream_class to user_attributes.
bt_event_class * bt_stream_class_borrow_event_class_by_id(bt_stream_class *stream_class, uint64_t id)
Borrows the event class having the numeric ID id from the stream class stream_class.
void bt_stream_class_set_supports_discarded_packets(bt_stream_class *stream_class, bt_bool supports_discarded_packets, bt_bool with_default_clock_snapshots)
Sets whether or not the instances (streams) of the stream class stream_class can have discarded packe...
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...
void bt_stream_class_set_supports_packets(bt_stream_class *stream_class, bt_bool supports_packets, bt_bool with_beginning_default_clock_snapshot, bt_bool with_end_default_clock_snapshot)
Sets whether or not the instances (streams) of the stream class stream_class have packets and...
Out of memory.
Definition: stream-class.h:869
void bt_stream_class_set_supports_discarded_events(bt_stream_class *stream_class, bt_bool supports_discarded_events, bt_bool with_default_clock_snapshots)
Sets whether or not the instances (streams) of the stream class stream_class can have discarded event...
const bt_field_class * bt_stream_class_borrow_event_common_context_field_class_const(const bt_stream_class *stream_class)
Borrows the event common context field class from the stream class stream_class (const version())...
bt_stream_class_set_name_status
Status codes for bt_stream_class_set_name().
Definition: stream-class.h:858
struct bt_field_class bt_field_class
Field class.
Definition: types.h:54
bt_stream_class * bt_stream_class_create(bt_trace_class *trace_class)
Creates a default stream class and adds it to the trace class trace_class.
bt_bool bt_stream_class_supports_discarded_packets(const bt_stream_class *stream_class)
Returns whether or not the instances (streams) of the stream class stream_class can have discarded pa...
const char * bt_stream_class_get_name(const bt_stream_class *stream_class)
Returns the name of the stream class stream_class.
bt_field_class * bt_stream_class_borrow_event_common_context_field_class(bt_stream_class *stream_class)
Borrows the event common context field class from the stream class stream_class.
bt_stream_class_set_field_class_status
Status codes for bt_stream_class_set_packet_context_field_class() and bt_stream_class_set_event_commo...
Definition: stream-class.h:1013
bt_event_class * bt_stream_class_borrow_event_class_by_index(bt_stream_class *stream_class, uint64_t index)
Borrows the event class at index index from the stream class stream_class.
bt_trace_class * bt_stream_class_borrow_trace_class(bt_stream_class *stream_class)
Borrows the trace class which contains the stream class stream_class.
Success.
Definition: stream-class.h:935
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...
uint64_t bt_stream_class_get_id(const bt_stream_class *stream_class)
Returns the numeric ID of the stream class stream_class.
bt_field_class * bt_stream_class_borrow_packet_context_field_class(bt_stream_class *stream_class)
Borrows the packet context field class from the stream class stream_class.
bt_bool bt_stream_class_assigns_automatic_event_class_id(const bt_stream_class *stream_class)
Returns whether or not the stream class stream_class automatically assigns a numeric ID to an event c...
struct bt_value bt_value
Value.
Definition: types.h:107
bt_value * bt_stream_class_borrow_user_attributes(bt_stream_class *stream_class)
Borrows the user attributes of the stream class stream_class.
struct bt_event_class bt_event_class
Event class.
Definition: types.h:51
const bt_field_class * bt_stream_class_borrow_packet_context_field_class_const(const bt_stream_class *stream_class)
Borrows the packet context field class from the stream class stream_class (const version).
bt_bool bt_stream_class_assigns_automatic_stream_id(const bt_stream_class *stream_class)
Returns whether or not the stream class stream_class automatically assigns a numeric ID to a stream y...
bt_stream_class_set_field_class_status bt_stream_class_set_packet_context_field_class(bt_stream_class *stream_class, bt_field_class *field_class)
Sets the packet context field class of the stream class stream_class to field_class.
void bt_stream_class_put_ref(const bt_stream_class *stream_class)
Decrements the reference count of the stream class stream_class.
int bt_bool
Babeltrace 2 boolean type.
Definition: types.h:140
bt_clock_class * bt_stream_class_borrow_default_clock_class(bt_stream_class *stream_class)
Borrows the default clock class from the stream class stream_class.
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...
bt_stream_class * bt_stream_class_create_with_id(bt_trace_class *trace_class, uint64_t id)
Creates a default stream class with the numeric ID id and adds it to the trace class trace_class...
struct bt_trace_class bt_trace_class
Trace class.
Definition: types.h:106
void bt_stream_class_set_assigns_automatic_event_class_id(bt_stream_class *stream_class, bt_bool assigns_automatic_event_class_id)
Sets whether or not the stream class stream_class automatically assigns a numeric ID to an event clas...
bt_stream_class_set_default_clock_class_status
Status codes for bt_stream_class_set_default_clock_class().
Definition: stream-class.h:930
const bt_value * bt_stream_class_borrow_user_attributes_const(const bt_stream_class *stream_class)
Borrows the user attributes of the stream class stream_class (const version).
bt_stream_class_set_name_status bt_stream_class_set_name(bt_stream_class *stream_class, const char *name)
Sets the name of the stream class stream_class to a copy of name.
bt_stream_class_set_default_clock_class_status bt_stream_class_set_default_clock_class(bt_stream_class *stream_class, bt_clock_class *clock_class)
Sets the default clock class of the stream class stream_class to clock_class.
struct bt_stream_class bt_stream_class
Stream class.
Definition: types.h:104
Success.
Definition: stream-class.h:863
void bt_stream_class_get_ref(const bt_stream_class *stream_class)
Increments the reference count of the stream class stream_class.
Success.
Definition: stream-class.h:1018
struct bt_clock_class bt_clock_class
Clock class.
Definition: types.h:36
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...
uint64_t bt_stream_class_get_event_class_count(const bt_stream_class *stream_class)
Returns the number of event classes contained in the stream class stream_class.
const bt_event_class * bt_stream_class_borrow_event_class_by_id_const(const bt_stream_class *stream_class, uint64_t id)
Borrows the event class having the numeric ID id from the stream class stream_class (const version)...
bt_bool bt_stream_class_supports_discarded_events(const bt_stream_class *stream_class)
Returns whether or not the instances (streams) of the stream class stream_class can have discarded ev...
bt_stream_class_set_field_class_status bt_stream_class_set_event_common_context_field_class(bt_stream_class *stream_class, bt_field_class *field_class)
Sets the event common context field class of the stream class stream_class to field_class.
const bt_event_class * bt_stream_class_borrow_event_class_by_index_const(const bt_stream_class *stream_class, uint64_t index)
Borrows the event class at index index from the stream class stream_class (const version).