CTF IR -> Trace IR
[babeltrace.git] / include / babeltrace / trace-ir / trace.h
1 #ifndef BABELTRACE_TRACE_IR_TRACE_H
2 #define BABELTRACE_TRACE_IR_TRACE_H
3
4 /*
5 * BabelTrace - Trace IR: Trace
6 *
7 * Copyright 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 *
9 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
10 *
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27 * SOFTWARE.
28 *
29 * The Common Trace Format (CTF) Specification is available at
30 * http://www.efficios.com/ctf
31 */
32
33 /* For bt_bool, bt_uuid */
34 #include <babeltrace/types.h>
35
36 #include <stdint.h>
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 struct bt_trace;
43 struct bt_stream;
44 struct bt_stream_class;
45 struct bt_field_type;
46 struct bt_value;
47 struct bt_packet_header_field;
48
49 typedef void (* bt_trace_is_static_listener)(
50 struct bt_trace *trace, void *data);
51
52 typedef void (* bt_trace_listener_removed)(
53 struct bt_trace *trace, void *data);
54
55 extern struct bt_trace *bt_trace_create(void);
56
57 extern bt_bool bt_trace_assigns_automatic_stream_class_id(
58 struct bt_trace *trace);
59
60 extern int bt_trace_set_assigns_automatic_stream_class_id(
61 struct bt_trace *trace, bt_bool value);
62
63 extern const char *bt_trace_get_name(struct bt_trace *trace);
64
65 extern int bt_trace_set_name(struct bt_trace *trace, const char *name);
66
67 extern bt_uuid bt_trace_get_uuid(struct bt_trace *trace);
68
69 extern int bt_trace_set_uuid(struct bt_trace *trace, bt_uuid uuid);
70
71 extern uint64_t bt_trace_get_environment_entry_count(struct bt_trace *trace);
72
73 extern void bt_trace_borrow_environment_entry_by_index(
74 struct bt_trace *trace, uint64_t index,
75 const char **name, struct bt_value **value);
76
77 extern struct bt_value *bt_trace_borrow_environment_entry_value_by_name(
78 struct bt_trace *trace, const char *name);
79
80 extern int bt_trace_set_environment_entry_integer(
81 struct bt_trace *trace, const char *name,
82 int64_t value);
83
84 extern int bt_trace_set_environment_entry_string(
85 struct bt_trace *trace, const char *name,
86 const char *value);
87
88 extern struct bt_field_type *bt_trace_borrow_packet_header_field_type(
89 struct bt_trace *trace);
90
91 extern int bt_trace_set_packet_header_field_type(struct bt_trace *trace,
92 struct bt_field_type *packet_header_type);
93
94 extern uint64_t bt_trace_get_stream_class_count(struct bt_trace *trace);
95
96 extern struct bt_stream_class *bt_trace_borrow_stream_class_by_index(
97 struct bt_trace *trace, uint64_t index);
98
99 extern struct bt_stream_class *bt_trace_borrow_stream_class_by_id(
100 struct bt_trace *trace, uint64_t id);
101
102 extern uint64_t bt_trace_get_stream_count(struct bt_trace *trace);
103
104 extern struct bt_stream *bt_trace_borrow_stream_by_index(
105 struct bt_trace *trace, uint64_t index);
106
107 extern struct bt_stream *bt_trace_borrow_stream_by_id(
108 struct bt_trace *trace, uint64_t id);
109
110 extern bt_bool bt_trace_is_static(struct bt_trace *trace);
111
112 extern int bt_trace_make_static(struct bt_trace *trace);
113
114 extern int bt_trace_add_is_static_listener(
115 struct bt_trace *trace,
116 bt_trace_is_static_listener listener,
117 bt_trace_listener_removed listener_removed, void *data,
118 uint64_t *listener_id);
119
120 extern int bt_trace_remove_is_static_listener(
121 struct bt_trace *trace, uint64_t listener_id);
122
123 #ifdef __cplusplus
124 }
125 #endif
126
127 #endif /* BABELTRACE_TRACE_IR_TRACE_H */
This page took 0.031864 seconds and 4 git commands to generate.