| 1 | #ifndef _BABELTRACE_CTF_EVENTS_INTERNAL_H |
| 2 | #define _BABELTRACE_CTF_EVENTS_INTERNAL_H |
| 3 | |
| 4 | /* |
| 5 | * BabelTrace |
| 6 | * |
| 7 | * CTF events API (internal) |
| 8 | * |
| 9 | * Copyright 2011-2012 EfficiOS Inc. and Linux Foundation |
| 10 | * |
| 11 | * Author: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| 12 | * Julien Desfossez <julien.desfossez@efficios.com> |
| 13 | * |
| 14 | * Permission is hereby granted, free of charge, to any person obtaining |
| 15 | * a copy of this software and associated documentation files (the |
| 16 | * "Software"), to deal in the Software without restriction, including |
| 17 | * without limitation the rights to use, copy, modify, merge, publish, |
| 18 | * distribute, sublicense, and/or sell copies of the Software, and to |
| 19 | * permit persons to whom the Software is furnished to do so, subject to |
| 20 | * the following conditions: |
| 21 | * |
| 22 | * The above copyright notice and this permission notice shall be |
| 23 | * included in all copies or substantial portions of the Software. |
| 24 | * |
| 25 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 26 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 27 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 28 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 29 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 30 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 31 | * SOFTWARE. |
| 32 | */ |
| 33 | |
| 34 | #include <babeltrace/iterator-internal.h> |
| 35 | #include <babeltrace/ctf/callbacks.h> |
| 36 | #include <babeltrace/ctf/callbacks-internal.h> |
| 37 | #include <babeltrace/ctf-ir/metadata.h> |
| 38 | #include <glib.h> |
| 39 | |
| 40 | struct ctf_stream_definition; |
| 41 | |
| 42 | /* |
| 43 | * These structures are public mappings to internal ctf_event structures. |
| 44 | */ |
| 45 | struct bt_ctf_event { |
| 46 | struct ctf_event_definition *parent; |
| 47 | }; |
| 48 | |
| 49 | struct bt_ctf_event_decl { |
| 50 | struct ctf_event_declaration parent; |
| 51 | GPtrArray *context_decl; |
| 52 | GPtrArray *fields_decl; |
| 53 | GPtrArray *packet_header_decl; |
| 54 | GPtrArray *event_context_decl; |
| 55 | GPtrArray *event_header_decl; |
| 56 | GPtrArray *packet_context_decl; |
| 57 | }; |
| 58 | |
| 59 | struct bt_ctf_iter { |
| 60 | struct bt_iter parent; |
| 61 | struct bt_ctf_event current_ctf_event; /* last read event */ |
| 62 | GArray *callbacks; /* Array of struct bt_stream_callbacks */ |
| 63 | struct bt_callback_chain main_callbacks; /* For all events */ |
| 64 | /* |
| 65 | * Flag indicating if dependency graph needs to be recalculated. |
| 66 | * Set by bt_iter_add_callback(), and checked (and |
| 67 | * cleared) by upon entry into bt_iter_read_event(). |
| 68 | * bt_iter_read_event() is responsible for calling dep |
| 69 | * graph calculation if it sees this flag set. |
| 70 | */ |
| 71 | int recalculate_dep_graph; |
| 72 | /* |
| 73 | * Array of pointers to struct bt_dependencies, for garbage |
| 74 | * collection. We're not using a linked list here because each |
| 75 | * struct bt_dependencies can belong to more than one |
| 76 | * bt_iter. |
| 77 | */ |
| 78 | GPtrArray *dep_gc; |
| 79 | uint64_t events_lost; |
| 80 | }; |
| 81 | |
| 82 | void ctf_print_discarded(FILE *fp, struct ctf_stream_definition *stream, |
| 83 | int end_stream); |
| 84 | |
| 85 | #endif /*_BABELTRACE_CTF_EVENTS_INTERNAL_H */ |