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 | ||
3fadfbc0 | 11 | #include <babeltrace2/trace-ir/trace.h> |
3fadfbc0 MJ |
12 | #include <babeltrace2/trace-ir/field-class.h> |
13 | #include <babeltrace2/trace-ir/field.h> | |
578e048b | 14 | #include "lib/object.h" |
3fadfbc0 MJ |
15 | #include <babeltrace2/value.h> |
16 | #include <babeltrace2/types.h> | |
daf01357 | 17 | #include <glib.h> |
c4f23e30 | 18 | #include <stdbool.h> |
daf01357 | 19 | #include <sys/types.h> |
6162e6b7 | 20 | #include "common/uuid.h" |
578e048b | 21 | |
578e048b MJ |
22 | #include "stream-class.h" |
23 | #include "trace-class.h" | |
daf01357 | 24 | |
cb6f1f7d | 25 | struct bt_trace { |
83509119 | 26 | struct bt_object base; |
44c440bc | 27 | |
862ca4ed | 28 | /* Owned by this */ |
c6962c96 PP |
29 | struct bt_value *user_attributes; |
30 | ||
31 | /* Owned by this */ | |
862ca4ed PP |
32 | struct bt_trace_class *class; |
33 | ||
44c440bc PP |
34 | struct { |
35 | GString *str; | |
36 | ||
37 | /* NULL or `str->str` above */ | |
38 | const char *value; | |
39 | } name; | |
40 | ||
335a2da5 | 41 | struct { |
6162e6b7 | 42 | bt_uuid_t uuid; |
335a2da5 PP |
43 | |
44 | /* NULL or `uuid` above */ | |
45 | bt_uuid value; | |
46 | } uuid; | |
47 | ||
48 | struct bt_value *environment; | |
49 | ||
44c440bc PP |
50 | /* Array of `struct bt_stream *` */ |
51 | GPtrArray *streams; | |
09840de5 PP |
52 | |
53 | /* | |
862ca4ed PP |
54 | * Stream class (weak, owned by owned trace class) to number of |
55 | * instantiated streams, used to automatically assign stream IDs | |
56 | * per stream class within this trace. | |
09840de5 | 57 | */ |
44c440bc PP |
58 | GHashTable *stream_classes_stream_count; |
59 | ||
ad5268b5 | 60 | GArray *destruction_listeners; |
44c440bc PP |
61 | bool frozen; |
62 | }; | |
9b888ff3 | 63 | |
40f4ba76 | 64 | void _bt_trace_freeze(const struct bt_trace *trace); |
3230ee6b | 65 | |
44c440bc PP |
66 | #ifdef BT_DEV_MODE |
67 | # define bt_trace_freeze _bt_trace_freeze | |
68 | #else | |
69 | # define bt_trace_freeze(_trace) | |
70 | #endif | |
3230ee6b | 71 | |
44c440bc | 72 | void bt_trace_add_stream(struct bt_trace *trace, struct bt_stream *stream); |
3230ee6b | 73 | |
40f4ba76 PP |
74 | uint64_t bt_trace_get_automatic_stream_id(const struct bt_trace *trace, |
75 | const struct bt_stream_class *stream_class); | |
3dca2276 | 76 | |
56e18c4c | 77 | #endif /* BABELTRACE_TRACE_IR_TRACE_INTERNAL_H */ |