Commit | Line | Data |
---|---|---|
272df73e | 1 | /* |
0235b0db MJ |
2 | * SPDX-License-Identifier: MIT |
3 | * | |
e2f7325d | 4 | * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com> |
272df73e | 5 | * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
272df73e PP |
6 | */ |
7 | ||
0235b0db MJ |
8 | #ifndef BABELTRACE_TRACE_IR_EVENT_CLASS_INTERNAL_H |
9 | #define BABELTRACE_TRACE_IR_EVENT_CLASS_INTERNAL_H | |
10 | ||
3fadfbc0 MJ |
11 | #include <babeltrace2/trace-ir/field-class.h> |
12 | #include <babeltrace2/trace-ir/field.h> | |
3fadfbc0 | 13 | #include <babeltrace2/value.h> |
3fadfbc0 MJ |
14 | #include <babeltrace2/trace-ir/stream-class.h> |
15 | #include <babeltrace2/trace-ir/stream.h> | |
16 | #include <babeltrace2/trace-ir/event-class.h> | |
578e048b MJ |
17 | #include "lib/object.h" |
18 | #include "common/assert.h" | |
19 | #include "lib/object-pool.h" | |
20 | #include "lib/property.h" | |
272df73e | 21 | #include <glib.h> |
44c440bc | 22 | #include <stdbool.h> |
272df73e | 23 | |
cb6f1f7d | 24 | struct bt_event_class { |
272df73e | 25 | struct bt_object base; |
5cd6d0e5 PP |
26 | struct bt_field_class *specific_context_fc; |
27 | struct bt_field_class *payload_fc; | |
272df73e | 28 | |
c6962c96 PP |
29 | /* Owned by this */ |
30 | struct bt_value *user_attributes; | |
31 | ||
44c440bc PP |
32 | struct { |
33 | GString *str; | |
5990dd44 | 34 | |
44c440bc PP |
35 | /* NULL or `str->str` above */ |
36 | const char *value; | |
37 | } name; | |
38 | ||
39 | uint64_t id; | |
40 | struct bt_property_uint log_level; | |
41 | ||
42 | struct { | |
43 | GString *str; | |
44 | ||
45 | /* NULL or `str->str` above */ | |
46 | const char *value; | |
47 | } emf_uri; | |
312c056a PP |
48 | |
49 | /* Pool of `struct bt_event *` */ | |
50 | struct bt_object_pool event_pool; | |
44c440bc PP |
51 | |
52 | bool frozen; | |
3dca2276 PP |
53 | }; |
54 | ||
40f4ba76 | 55 | void _bt_event_class_freeze(const struct bt_event_class *event_class); |
272df73e | 56 | |
44c440bc PP |
57 | #ifdef BT_DEV_MODE |
58 | # define bt_event_class_freeze _bt_event_class_freeze | |
59 | #else | |
60 | # define bt_event_class_freeze(_ec) | |
61 | #endif | |
3dca2276 | 62 | |
44c440bc PP |
63 | static inline |
64 | struct bt_stream_class *bt_event_class_borrow_stream_class_inline( | |
40f4ba76 | 65 | const struct bt_event_class *event_class) |
44c440bc | 66 | { |
98b15851 | 67 | BT_ASSERT_DBG(event_class); |
44c440bc PP |
68 | return (void *) bt_object_borrow_parent(&event_class->base); |
69 | } | |
3dca2276 | 70 | |
56e18c4c | 71 | #endif /* BABELTRACE_TRACE_IR_EVENT_CLASS_INTERNAL_H */ |