Commit | Line | Data |
---|---|---|
daf01357 | 1 | /* |
0235b0db MJ |
2 | * SPDX-License-Identifier: MIT |
3 | * | |
e2f7325d | 4 | * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com> |
daf01357 | 5 | * Copyright 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
daf01357 JG |
6 | */ |
7 | ||
0235b0db MJ |
8 | #ifndef BABELTRACE_TRACE_IR_TRACE_INTERNAL_H |
9 | #define BABELTRACE_TRACE_IR_TRACE_INTERNAL_H | |
10 | ||
d98421f2 | 11 | #include "lib/assert-cond.h" |
3fadfbc0 | 12 | #include <babeltrace2/trace-ir/trace.h> |
3fadfbc0 MJ |
13 | #include <babeltrace2/trace-ir/field-class.h> |
14 | #include <babeltrace2/trace-ir/field.h> | |
578e048b MJ |
15 | #include "lib/object.h" |
16 | #include "lib/object-pool.h" | |
91d81473 | 17 | #include "common/macros.h" |
3fadfbc0 MJ |
18 | #include <babeltrace2/value.h> |
19 | #include <babeltrace2/types.h> | |
daf01357 | 20 | #include <glib.h> |
c4f23e30 | 21 | #include <stdbool.h> |
daf01357 | 22 | #include <sys/types.h> |
6162e6b7 | 23 | #include "common/uuid.h" |
578e048b MJ |
24 | |
25 | #include "attributes.h" | |
26 | #include "clock-class.h" | |
27 | #include "stream-class.h" | |
28 | #include "trace-class.h" | |
daf01357 | 29 | |
cb6f1f7d | 30 | struct bt_trace { |
83509119 | 31 | struct bt_object base; |
44c440bc | 32 | |
862ca4ed | 33 | /* Owned by this */ |
c6962c96 PP |
34 | struct bt_value *user_attributes; |
35 | ||
36 | /* Owned by this */ | |
862ca4ed PP |
37 | struct bt_trace_class *class; |
38 | ||
44c440bc PP |
39 | struct { |
40 | GString *str; | |
41 | ||
42 | /* NULL or `str->str` above */ | |
43 | const char *value; | |
44 | } name; | |
45 | ||
335a2da5 | 46 | struct { |
6162e6b7 | 47 | bt_uuid_t uuid; |
335a2da5 PP |
48 | |
49 | /* NULL or `uuid` above */ | |
50 | bt_uuid value; | |
51 | } uuid; | |
52 | ||
53 | struct bt_value *environment; | |
54 | ||
44c440bc PP |
55 | /* Array of `struct bt_stream *` */ |
56 | GPtrArray *streams; | |
09840de5 PP |
57 | |
58 | /* | |
862ca4ed PP |
59 | * Stream class (weak, owned by owned trace class) to number of |
60 | * instantiated streams, used to automatically assign stream IDs | |
61 | * per stream class within this trace. | |
09840de5 | 62 | */ |
44c440bc PP |
63 | GHashTable *stream_classes_stream_count; |
64 | ||
ad5268b5 | 65 | GArray *destruction_listeners; |
44c440bc PP |
66 | bool frozen; |
67 | }; | |
9b888ff3 | 68 | |
c9d90a34 | 69 | BT_HIDDEN |
40f4ba76 | 70 | void _bt_trace_freeze(const struct bt_trace *trace); |
3230ee6b | 71 | |
44c440bc PP |
72 | #ifdef BT_DEV_MODE |
73 | # define bt_trace_freeze _bt_trace_freeze | |
74 | #else | |
75 | # define bt_trace_freeze(_trace) | |
76 | #endif | |
3230ee6b | 77 | |
44c440bc PP |
78 | BT_HIDDEN |
79 | void bt_trace_add_stream(struct bt_trace *trace, struct bt_stream *stream); | |
3230ee6b | 80 | |
5b876b06 | 81 | BT_HIDDEN |
40f4ba76 PP |
82 | uint64_t bt_trace_get_automatic_stream_id(const struct bt_trace *trace, |
83 | const struct bt_stream_class *stream_class); | |
3dca2276 | 84 | |
56e18c4c | 85 | #endif /* BABELTRACE_TRACE_IR_TRACE_INTERNAL_H */ |