Commit | Line | Data |
---|---|---|
273b65be | 1 | /* |
0235b0db MJ |
2 | * SPDX-License-Identifier: MIT |
3 | * | |
e2f7325d | 4 | * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com> |
de9dd397 | 5 | * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
273b65be JG |
6 | */ |
7 | ||
0235b0db MJ |
8 | #ifndef BABELTRACE_TRACE_IR_STREAM_INTERNAL_H |
9 | #define BABELTRACE_TRACE_IR_STREAM_INTERNAL_H | |
10 | ||
3fadfbc0 | 11 | #include <babeltrace2/trace-ir/stream.h> |
578e048b MJ |
12 | #include "lib/object.h" |
13 | #include "lib/object-pool.h" | |
91d81473 | 14 | #include "common/macros.h" |
273b65be | 15 | #include <glib.h> |
c4f23e30 | 16 | #include <stdbool.h> |
273b65be | 17 | |
578e048b MJ |
18 | #include "utils.h" |
19 | ||
3dca2276 | 20 | struct bt_stream_class; |
cb6f1f7d | 21 | struct bt_stream; |
3230ee6b | 22 | |
cb6f1f7d | 23 | struct bt_stream { |
83509119 | 24 | struct bt_object base; |
44c440bc | 25 | |
c6962c96 PP |
26 | /* Owned by this */ |
27 | struct bt_value *user_attributes; | |
28 | ||
862ca4ed | 29 | /* Owned by this */ |
44c440bc PP |
30 | struct bt_stream_class *class; |
31 | ||
32 | struct { | |
33 | GString *str; | |
34 | ||
35 | /* NULL or `str->str` above */ | |
36 | const char *value; | |
37 | } name; | |
38 | ||
39 | uint64_t id; | |
312c056a PP |
40 | |
41 | /* Pool of `struct bt_packet *` */ | |
42 | struct bt_object_pool packet_pool; | |
44c440bc PP |
43 | |
44 | bool frozen; | |
3dca2276 PP |
45 | }; |
46 | ||
40f4ba76 | 47 | void _bt_stream_freeze(const struct bt_stream *stream); |
44c440bc PP |
48 | |
49 | #ifdef BT_DEV_MODE | |
50 | # define bt_stream_freeze _bt_stream_freeze | |
51 | #else | |
52 | # define bt_stream_freeze(_stream) | |
53 | #endif | |
54 | ||
862ca4ed PP |
55 | static inline |
56 | struct bt_trace *bt_stream_borrow_trace_inline(const struct bt_stream *stream) | |
57 | { | |
98b15851 | 58 | BT_ASSERT_DBG(stream); |
862ca4ed PP |
59 | return (void *) bt_object_borrow_parent(&stream->base); |
60 | } | |
61 | ||
56e18c4c | 62 | #endif /* BABELTRACE_TRACE_IR_STREAM_INTERNAL_H */ |