1 #ifndef BABELTRACE_TRACE_IR_TRACE_H
2 #define BABELTRACE_TRACE_IR_TRACE_H
5 * BabelTrace - Trace IR: Trace
7 * Copyright 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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:
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
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
29 * The Common Trace Format (CTF) Specification is available at
30 * http://www.efficios.com/ctf
33 /* For bt_bool, bt_uuid */
34 #include <babeltrace/types.h>
44 struct bt_stream_class
;
47 struct bt_packet_header_field
;
49 typedef void (* bt_trace_is_static_listener
)(
50 struct bt_trace
*trace
, void *data
);
52 typedef void (* bt_trace_listener_removed
)(
53 struct bt_trace
*trace
, void *data
);
55 extern struct bt_trace
*bt_trace_create(void);
57 extern bt_bool
bt_trace_assigns_automatic_stream_class_id(
58 struct bt_trace
*trace
);
60 extern int bt_trace_set_assigns_automatic_stream_class_id(
61 struct bt_trace
*trace
, bt_bool value
);
63 extern const char *bt_trace_get_name(struct bt_trace
*trace
);
65 extern int bt_trace_set_name(struct bt_trace
*trace
, const char *name
);
67 extern bt_uuid
bt_trace_get_uuid(struct bt_trace
*trace
);
69 extern int bt_trace_set_uuid(struct bt_trace
*trace
, bt_uuid uuid
);
71 extern uint64_t bt_trace_get_environment_entry_count(struct bt_trace
*trace
);
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
);
77 extern struct bt_value
*bt_trace_borrow_environment_entry_value_by_name(
78 struct bt_trace
*trace
, const char *name
);
80 extern int bt_trace_set_environment_entry_integer(
81 struct bt_trace
*trace
, const char *name
,
84 extern int bt_trace_set_environment_entry_string(
85 struct bt_trace
*trace
, const char *name
,
88 extern struct bt_field_type
*bt_trace_borrow_packet_header_field_type(
89 struct bt_trace
*trace
);
91 extern int bt_trace_set_packet_header_field_type(struct bt_trace
*trace
,
92 struct bt_field_type
*packet_header_type
);
94 extern uint64_t bt_trace_get_stream_class_count(struct bt_trace
*trace
);
96 extern struct bt_stream_class
*bt_trace_borrow_stream_class_by_index(
97 struct bt_trace
*trace
, uint64_t index
);
99 extern struct bt_stream_class
*bt_trace_borrow_stream_class_by_id(
100 struct bt_trace
*trace
, uint64_t id
);
102 extern uint64_t bt_trace_get_stream_count(struct bt_trace
*trace
);
104 extern struct bt_stream
*bt_trace_borrow_stream_by_index(
105 struct bt_trace
*trace
, uint64_t index
);
107 extern struct bt_stream
*bt_trace_borrow_stream_by_id(
108 struct bt_trace
*trace
, uint64_t id
);
110 extern bt_bool
bt_trace_is_static(struct bt_trace
*trace
);
112 extern int bt_trace_make_static(struct bt_trace
*trace
);
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
);
120 extern int bt_trace_remove_is_static_listener(
121 struct bt_trace
*trace
, uint64_t listener_id
);
127 #endif /* BABELTRACE_TRACE_IR_TRACE_H */