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 | ||
b91e0631 | 34 | gchar *name; |
44c440bc | 35 | |
335a2da5 | 36 | struct { |
6162e6b7 | 37 | bt_uuid_t uuid; |
335a2da5 PP |
38 | |
39 | /* NULL or `uuid` above */ | |
40 | bt_uuid value; | |
41 | } uuid; | |
42 | ||
43 | struct bt_value *environment; | |
44 | ||
44c440bc PP |
45 | /* Array of `struct bt_stream *` */ |
46 | GPtrArray *streams; | |
09840de5 PP |
47 | |
48 | /* | |
862ca4ed PP |
49 | * Stream class (weak, owned by owned trace class) to number of |
50 | * instantiated streams, used to automatically assign stream IDs | |
51 | * per stream class within this trace. | |
09840de5 | 52 | */ |
44c440bc PP |
53 | GHashTable *stream_classes_stream_count; |
54 | ||
ad5268b5 | 55 | GArray *destruction_listeners; |
44c440bc PP |
56 | bool frozen; |
57 | }; | |
9b888ff3 | 58 | |
40f4ba76 | 59 | void _bt_trace_freeze(const struct bt_trace *trace); |
3230ee6b | 60 | |
44c440bc PP |
61 | #ifdef BT_DEV_MODE |
62 | # define bt_trace_freeze _bt_trace_freeze | |
63 | #else | |
64 | # define bt_trace_freeze(_trace) | |
65 | #endif | |
3230ee6b | 66 | |
44c440bc | 67 | void bt_trace_add_stream(struct bt_trace *trace, struct bt_stream *stream); |
3230ee6b | 68 | |
40f4ba76 PP |
69 | uint64_t bt_trace_get_automatic_stream_id(const struct bt_trace *trace, |
70 | const struct bt_stream_class *stream_class); | |
3dca2276 | 71 | |
56e18c4c | 72 | #endif /* BABELTRACE_TRACE_IR_TRACE_INTERNAL_H */ |