| 1 | /* |
| 2 | * SPDX-License-Identifier: MIT |
| 3 | * |
| 4 | * Copyright 2019 Philippe Proulx <pproulx@efficios.com> |
| 5 | */ |
| 6 | |
| 7 | #ifndef BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_HPP |
| 8 | #define BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_HPP |
| 9 | |
| 10 | #include <glib.h> |
| 11 | |
| 12 | #include <babeltrace2/babeltrace.h> |
| 13 | |
| 14 | #include "cpp-common/bt2c/logging.hpp" |
| 15 | |
| 16 | struct fs_sink_comp |
| 17 | { |
| 18 | explicit fs_sink_comp(const bt2::SelfSinkComponent selfSinkComp) : |
| 19 | logger {selfSinkComp, "PLUGIN/SINK.CTF.FS/COMP"} |
| 20 | { |
| 21 | } |
| 22 | |
| 23 | bt2c::Logger logger; |
| 24 | |
| 25 | /* Owned by this */ |
| 26 | bt_message_iterator *upstream_iter = nullptr; |
| 27 | |
| 28 | /* Base output directory path */ |
| 29 | GString *output_dir_path = nullptr; |
| 30 | |
| 31 | /* |
| 32 | * True if the component assumes that it will only write a |
| 33 | * single CTF trace (which can contain one or more data |
| 34 | * streams). This makes the component write the stream files |
| 35 | * directly in the output directory (`output_dir_path` above). |
| 36 | */ |
| 37 | bool assume_single_trace = false; |
| 38 | |
| 39 | /* True to completely ignore discarded events messages */ |
| 40 | bool ignore_discarded_events = false; |
| 41 | |
| 42 | /* True to completely ignore discarded packets messages */ |
| 43 | bool ignore_discarded_packets = false; |
| 44 | |
| 45 | /* |
| 46 | * True to make the component quiet (nothing printed to the |
| 47 | * standard output). |
| 48 | */ |
| 49 | bool quiet = false; |
| 50 | |
| 51 | /* |
| 52 | * Hash table of `const bt_trace *` (weak) to |
| 53 | * `struct fs_sink_trace *` (owned by hash table). |
| 54 | */ |
| 55 | GHashTable *traces = nullptr; |
| 56 | }; |
| 57 | |
| 58 | bt_component_class_initialize_method_status |
| 59 | ctf_fs_sink_init(bt_self_component_sink *component, bt_self_component_sink_configuration *config, |
| 60 | const bt_value *params, void *init_method_data); |
| 61 | |
| 62 | bt_component_class_sink_consume_method_status |
| 63 | ctf_fs_sink_consume(bt_self_component_sink *component); |
| 64 | |
| 65 | bt_component_class_sink_graph_is_configured_method_status |
| 66 | ctf_fs_sink_graph_is_configured(bt_self_component_sink *component); |
| 67 | |
| 68 | void ctf_fs_sink_finalize(bt_self_component_sink *component); |
| 69 | |
| 70 | #endif /* BABELTRACE_PLUGINS_CTF_FS_SINK_FS_SINK_HPP */ |