Commit | Line | Data |
---|---|---|
bc37ae52 JG |
1 | #ifndef BABELTRACE_CTF_IR_TRACE_H |
2 | #define BABELTRACE_CTF_IR_TRACE_H | |
3 | ||
4 | /* | |
5 | * BabelTrace - CTF 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 | ||
44c440bc | 33 | /* For bt_bool, bt_uuid */ |
c55a9f58 | 34 | #include <babeltrace/types.h> |
44c440bc | 35 | |
410d0373 | 36 | #include <stdint.h> |
bc37ae52 JG |
37 | |
38 | #ifdef __cplusplus | |
39 | extern "C" { | |
40 | #endif | |
41 | ||
50842bdc PP |
42 | struct bt_trace; |
43 | struct bt_stream; | |
44 | struct bt_stream_class; | |
312c056a PP |
45 | struct bt_field_type; |
46 | struct bt_value; | |
47 | struct bt_packet_header_field; | |
bc37ae52 | 48 | |
50842bdc | 49 | typedef void (* bt_trace_is_static_listener)( |
44c440bc | 50 | struct bt_trace *trace, void *data); |
8480c8cc | 51 | |
50842bdc | 52 | typedef void (* bt_trace_listener_removed)( |
44c440bc | 53 | struct bt_trace *trace, void *data); |
06300316 | 54 | |
50842bdc | 55 | extern struct bt_trace *bt_trace_create(void); |
bc37ae52 | 56 | |
44c440bc PP |
57 | extern bt_bool bt_trace_assigns_automatic_stream_class_id( |
58 | struct bt_trace *trace); | |
06300316 | 59 | |
44c440bc PP |
60 | extern int bt_trace_set_assigns_automatic_stream_class_id( |
61 | struct bt_trace *trace, bt_bool value); | |
06300316 | 62 | |
44c440bc | 63 | extern const char *bt_trace_get_name(struct bt_trace *trace); |
06300316 | 64 | |
44c440bc | 65 | extern int bt_trace_set_name(struct bt_trace *trace, const char *name); |
06300316 | 66 | |
44c440bc | 67 | extern bt_uuid bt_trace_get_uuid(struct bt_trace *trace); |
bc37ae52 | 68 | |
44c440bc | 69 | extern int bt_trace_set_uuid(struct bt_trace *trace, bt_uuid uuid); |
06300316 | 70 | |
44c440bc | 71 | extern uint64_t bt_trace_get_environment_entry_count(struct bt_trace *trace); |
06300316 | 72 | |
44c440bc PP |
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); | |
06300316 | 76 | |
44c440bc PP |
77 | extern struct bt_value *bt_trace_borrow_environment_entry_value_by_name( |
78 | struct bt_trace *trace, const char *name); | |
06300316 | 79 | |
44c440bc PP |
80 | extern int bt_trace_set_environment_entry_integer( |
81 | struct bt_trace *trace, const char *name, | |
06300316 | 82 | int64_t value); |
884cd6c3 | 83 | |
44c440bc PP |
84 | extern int bt_trace_set_environment_entry_string( |
85 | struct bt_trace *trace, const char *name, | |
06300316 PP |
86 | const char *value); |
87 | ||
094ff7c0 | 88 | extern struct bt_field_type *bt_trace_borrow_packet_header_field_type( |
312c056a PP |
89 | struct bt_trace *trace); |
90 | ||
44c440bc | 91 | extern int bt_trace_set_packet_header_field_type(struct bt_trace *trace, |
50842bdc | 92 | struct bt_field_type *packet_header_type); |
06300316 | 93 | |
44c440bc | 94 | extern uint64_t bt_trace_get_stream_class_count(struct bt_trace *trace); |
06300316 | 95 | |
094ff7c0 | 96 | extern struct bt_stream_class *bt_trace_borrow_stream_class_by_index( |
44c440bc | 97 | struct bt_trace *trace, uint64_t index); |
094ff7c0 PP |
98 | |
99 | extern struct bt_stream_class *bt_trace_borrow_stream_class_by_id( | |
44c440bc | 100 | struct bt_trace *trace, uint64_t id); |
06300316 | 101 | |
44c440bc | 102 | extern uint64_t bt_trace_get_stream_count(struct bt_trace *trace); |
c1e730fe | 103 | |
094ff7c0 | 104 | extern struct bt_stream *bt_trace_borrow_stream_by_index( |
44c440bc | 105 | struct bt_trace *trace, uint64_t index); |
5acf2ae6 | 106 | |
44c440bc PP |
107 | extern struct bt_stream *bt_trace_borrow_stream_by_id( |
108 | struct bt_trace *trace, uint64_t id); | |
5acf2ae6 | 109 | |
44c440bc | 110 | extern bt_bool bt_trace_is_static(struct bt_trace *trace); |
5acf2ae6 | 111 | |
44c440bc | 112 | extern int bt_trace_make_static(struct bt_trace *trace); |
5acf2ae6 | 113 | |
50842bdc | 114 | extern int bt_trace_add_is_static_listener( |
44c440bc | 115 | struct bt_trace *trace, |
50842bdc | 116 | bt_trace_is_static_listener listener, |
44c440bc PP |
117 | bt_trace_listener_removed listener_removed, void *data, |
118 | uint64_t *listener_id); | |
3602afb0 | 119 | |
50842bdc | 120 | extern int bt_trace_remove_is_static_listener( |
44c440bc | 121 | struct bt_trace *trace, uint64_t listener_id); |
35827558 | 122 | |
bc37ae52 JG |
123 | #ifdef __cplusplus |
124 | } | |
125 | #endif | |
126 | ||
127 | #endif /* BABELTRACE_CTF_IR_TRACE_H */ |