cpp-common/bt2c/fmt.hpp: use `wise_enum::string_type` in `EnableIfIsWiseEnum` definition
[babeltrace.git] / src / lib / trace-ir / trace.h
1 /*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
5 * Copyright 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 */
7
8 #ifndef BABELTRACE_TRACE_IR_TRACE_INTERNAL_H
9 #define BABELTRACE_TRACE_IR_TRACE_INTERNAL_H
10
11 #include <babeltrace2/trace-ir/trace.h>
12 #include <babeltrace2/trace-ir/field-class.h>
13 #include <babeltrace2/trace-ir/field.h>
14 #include "lib/object.h"
15 #include <babeltrace2/value.h>
16 #include <babeltrace2/types.h>
17 #include <glib.h>
18 #include <stdbool.h>
19 #include <sys/types.h>
20 #include "common/uuid.h"
21
22 #include "stream-class.h"
23 #include "trace-class.h"
24
25 struct bt_trace {
26 struct bt_object base;
27
28 /* Owned by this */
29 struct bt_value *user_attributes;
30
31 /* Owned by this */
32 struct bt_trace_class *class;
33
34 struct {
35 GString *str;
36
37 /* NULL or `str->str` above */
38 const char *value;
39 } name;
40
41 struct {
42 bt_uuid_t uuid;
43
44 /* NULL or `uuid` above */
45 bt_uuid value;
46 } uuid;
47
48 struct bt_value *environment;
49
50 /* Array of `struct bt_stream *` */
51 GPtrArray *streams;
52
53 /*
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.
57 */
58 GHashTable *stream_classes_stream_count;
59
60 GArray *destruction_listeners;
61 bool frozen;
62 };
63
64 void _bt_trace_freeze(const struct bt_trace *trace);
65
66 #ifdef BT_DEV_MODE
67 # define bt_trace_freeze _bt_trace_freeze
68 #else
69 # define bt_trace_freeze(_trace)
70 #endif
71
72 void bt_trace_add_stream(struct bt_trace *trace, struct bt_stream *stream);
73
74 uint64_t bt_trace_get_automatic_stream_id(const struct bt_trace *trace,
75 const struct bt_stream_class *stream_class);
76
77 #endif /* BABELTRACE_TRACE_IR_TRACE_INTERNAL_H */
This page took 0.031128 seconds and 4 git commands to generate.