61ff918e53a9f7fac041a63e489757ceafbc1347
[babeltrace.git] / src / lib / trace-ir / event-class.h
1 /*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
5 * Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 */
7
8 #ifndef BABELTRACE_TRACE_IR_EVENT_CLASS_INTERNAL_H
9 #define BABELTRACE_TRACE_IR_EVENT_CLASS_INTERNAL_H
10
11 #include "lib/assert-pre.h"
12 #include <babeltrace2/trace-ir/field-class.h>
13 #include <babeltrace2/trace-ir/field.h>
14 #include "common/macros.h"
15 #include <babeltrace2/value.h>
16 #include <babeltrace2/trace-ir/stream-class.h>
17 #include <babeltrace2/trace-ir/stream.h>
18 #include <babeltrace2/trace-ir/event-class.h>
19 #include "lib/object.h"
20 #include "common/assert.h"
21 #include "lib/object-pool.h"
22 #include "lib/property.h"
23 #include <glib.h>
24 #include <stdbool.h>
25
26 #include "trace.h"
27
28 struct bt_event_class {
29 struct bt_object base;
30 struct bt_field_class *specific_context_fc;
31 struct bt_field_class *payload_fc;
32
33 /* Owned by this */
34 struct bt_value *user_attributes;
35
36 struct {
37 GString *str;
38
39 /* NULL or `str->str` above */
40 const char *value;
41 } name;
42
43 uint64_t id;
44 struct bt_property_uint log_level;
45
46 struct {
47 GString *str;
48
49 /* NULL or `str->str` above */
50 const char *value;
51 } emf_uri;
52
53 /* Pool of `struct bt_event *` */
54 struct bt_object_pool event_pool;
55
56 bool frozen;
57 };
58
59 BT_HIDDEN
60 void _bt_event_class_freeze(const struct bt_event_class *event_class);
61
62 #ifdef BT_DEV_MODE
63 # define bt_event_class_freeze _bt_event_class_freeze
64 #else
65 # define bt_event_class_freeze(_ec)
66 #endif
67
68 static inline
69 struct bt_stream_class *bt_event_class_borrow_stream_class_inline(
70 const struct bt_event_class *event_class)
71 {
72 BT_ASSERT_DBG(event_class);
73 return (void *) bt_object_borrow_parent(&event_class->base);
74 }
75
76 #endif /* BABELTRACE_TRACE_IR_EVENT_CLASS_INTERNAL_H */
This page took 0.030872 seconds and 4 git commands to generate.