2 * SPDX-License-Identifier: MIT
4 * Copyright 2016-2017 Philippe Proulx <pproulx@efficios.com>
6 * Babeltrace trace converter - CLI tool's configuration
9 #ifndef CLI_BABELTRACE_CFG_H
10 #define CLI_BABELTRACE_CFG_H
15 #include <babeltrace2/value.h>
16 #include "lib/object.h"
17 #include "compat/compiler.h"
18 #include <babeltrace2/graph/component-class.h>
21 enum bt_config_command
{
22 BT_CONFIG_COMMAND_RUN
,
23 BT_CONFIG_COMMAND_PRINT_CTF_METADATA
,
24 BT_CONFIG_COMMAND_PRINT_LTTNG_LIVE_SESSIONS
,
25 BT_CONFIG_COMMAND_LIST_PLUGINS
,
26 BT_CONFIG_COMMAND_HELP
,
27 BT_CONFIG_COMMAND_QUERY
,
30 struct bt_config_component
{
32 bt_component_class_type type
;
34 GString
*comp_cls_name
;
36 GString
*instance_name
;
40 struct bt_config_connection
{
41 GString
*upstream_comp_name
;
42 GString
*downstream_comp_name
;
43 GString
*upstream_port_glob
;
44 GString
*downstream_port_glob
;
50 bt_value
*plugin_paths
;
51 bool omit_system_plugin_path
;
52 bool omit_home_plugin_path
;
53 bool command_needs_plugins
;
54 const char *command_name
;
56 enum bt_config_command command
;
58 /* BT_CONFIG_COMMAND_RUN */
60 /* Array of pointers to struct bt_config_component */
63 /* Array of pointers to struct bt_config_component */
66 /* Array of pointers to struct bt_config_component */
69 /* Array of pointers to struct bt_config_connection */
70 GPtrArray
*connections
;
73 * Number of microseconds to sleep when we need
74 * to retry to run the graph.
76 uint64_t retry_duration_us
;
79 * Whether or not to trim the source trace to the
80 * intersection of its streams.
82 bool stream_intersection_mode
;
85 /* BT_CONFIG_COMMAND_HELP */
87 struct bt_config_component
*cfg_component
;
90 /* BT_CONFIG_COMMAND_QUERY */
93 struct bt_config_component
*cfg_component
;
96 /* BT_CONFIG_COMMAND_PRINT_CTF_METADATA */
100 } print_ctf_metadata
;
102 /* BT_CONFIG_COMMAND_PRINT_LTTNG_LIVE_SESSIONS */
105 GString
*output_path
;
106 } print_lttng_live_sessions
;
111 struct bt_config_component
*bt_config_get_component(GPtrArray
*array
,
114 struct bt_config_component
*comp
= g_ptr_array_index(array
, index
);
116 bt_object_get_ref(comp
);
120 int bt_config_append_plugin_paths(bt_value
*plugin_paths
,
123 void bt_config_connection_destroy(struct bt_config_connection
*connection
);
125 #endif /* CLI_BABELTRACE_CFG_H */