Commit | Line | Data |
---|---|---|
70bd0a12 JD |
1 | #ifndef _BABELTRACE_INTERNAL_H |
2 | #define _BABELTRACE_INTERNAL_H | |
3 | ||
eb31c5e6 MD |
4 | /* |
5 | * babeltrace/babeltrace-internal.h | |
6 | * | |
7 | * Copyright 2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
8 | * | |
9 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
10 | * of this software and associated documentation files (the "Software"), to deal | |
11 | * in the Software without restriction, including without limitation the rights | |
12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
13 | * copies of the Software, and to permit persons to whom the Software is | |
14 | * furnished to do so, subject to the following conditions: | |
15 | * | |
16 | * The above copyright notice and this permission notice shall be included in | |
17 | * all copies or substantial portions of the Software. | |
c462e188 MD |
18 | * |
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
25 | * SOFTWARE. | |
eb31c5e6 | 26 | */ |
70bd0a12 JD |
27 | #include <stdio.h> |
28 | #include <glib.h> | |
11ac6674 | 29 | #include <stdint.h> |
70bd0a12 JD |
30 | |
31 | extern int babeltrace_verbose, babeltrace_debug; | |
32 | ||
3394d22e MD |
33 | #define printf_verbose(fmt, args...) \ |
34 | do { \ | |
35 | if (babeltrace_verbose) \ | |
36 | fprintf(stdout, "[verbose] " fmt, ## args); \ | |
70bd0a12 JD |
37 | } while (0) |
38 | ||
3394d22e MD |
39 | #define printf_debug(fmt, args...) \ |
40 | do { \ | |
41 | if (babeltrace_debug) \ | |
42 | fprintf(stdout, "[debug] " fmt, ## args); \ | |
70bd0a12 JD |
43 | } while (0) |
44 | ||
90bf3cef MD |
45 | #define likely(x) __builtin_expect(!!(x), 1) |
46 | #define unlikely(x) __builtin_expect(!!(x), 0) | |
47 | ||
5d6c80a5 JD |
48 | /* |
49 | * BT_HIDDEN: set the hidden attribute for internal functions | |
50 | */ | |
51 | #define BT_HIDDEN __attribute__((visibility("hidden"))) | |
52 | ||
1b8455b7 | 53 | struct bt_trace_descriptor; |
70bd0a12 | 54 | struct trace_collection { |
1b8455b7 | 55 | GPtrArray *array; /* struct bt_trace_descriptor */ |
a44bc4c9 | 56 | GHashTable *clocks; /* struct ctf_clock */ |
0716bb06 MD |
57 | |
58 | uint64_t single_clock_offset_avg; | |
59 | uint64_t offset_first; | |
60 | int64_t delta_offset_first_sum; | |
61 | int offset_nr; | |
50052405 | 62 | int clock_use_offset_avg; |
70bd0a12 JD |
63 | }; |
64 | ||
cba1661c MD |
65 | extern int opt_all_field_names, |
66 | opt_scope_field_names, | |
67 | opt_header_field_names, | |
68 | opt_context_field_names, | |
82662ad4 | 69 | opt_payload_field_names, |
359d7456 MD |
70 | opt_all_fields, |
71 | opt_trace_field, | |
72 | opt_trace_domain_field, | |
73 | opt_trace_procname_field, | |
74 | opt_trace_vpid_field, | |
32cfb8ad | 75 | opt_trace_hostname_field, |
c3815874 | 76 | opt_trace_default_fields, |
359d7456 | 77 | opt_loglevel_field, |
f6714e20 | 78 | opt_emf_field, |
f133896d | 79 | opt_callsite_field, |
11ac6674 | 80 | opt_delta_field, |
03798a93 | 81 | opt_clock_cycles, |
11ac6674 MD |
82 | opt_clock_seconds, |
83 | opt_clock_date, | |
82ace6d6 MD |
84 | opt_clock_gmt, |
85 | opt_clock_force_correlate; | |
11ac6674 MD |
86 | |
87 | extern uint64_t opt_clock_offset; | |
70bd0a12 JD |
88 | |
89 | #endif |