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 "lib/object.h"
16 #include "compat/compiler.h"
19 enum bt_config_command
{
20 BT_CONFIG_COMMAND_RUN
,
21 BT_CONFIG_COMMAND_PRINT_CTF_METADATA
,
22 BT_CONFIG_COMMAND_PRINT_LTTNG_LIVE_SESSIONS
,
23 BT_CONFIG_COMMAND_LIST_PLUGINS
,
24 BT_CONFIG_COMMAND_HELP
,
25 BT_CONFIG_COMMAND_QUERY
,
28 struct bt_config_component
{
30 bt_component_class_type type
;
32 GString
*comp_cls_name
;
34 GString
*instance_name
;
38 struct bt_config_connection
{
39 GString
*upstream_comp_name
;
40 GString
*downstream_comp_name
;
41 GString
*upstream_port_glob
;
42 GString
*downstream_port_glob
;
48 bt_value
*plugin_paths
;
49 bool omit_system_plugin_path
;
50 bool omit_home_plugin_path
;
51 bool command_needs_plugins
;
52 const char *command_name
;
54 enum bt_config_command command
;
56 /* BT_CONFIG_COMMAND_RUN */
58 /* Array of pointers to struct bt_config_component */
61 /* Array of pointers to struct bt_config_component */
64 /* Array of pointers to struct bt_config_component */
67 /* Array of pointers to struct bt_config_connection */
68 GPtrArray
*connections
;
71 * Number of microseconds to sleep when we need
72 * to retry to run the graph.
74 uint64_t retry_duration_us
;
77 * Whether or not to trim the source trace to the
78 * intersection of its streams.
80 bool stream_intersection_mode
;
83 /* BT_CONFIG_COMMAND_HELP */
85 struct bt_config_component
*cfg_component
;
88 /* BT_CONFIG_COMMAND_QUERY */
91 struct bt_config_component
*cfg_component
;
94 /* BT_CONFIG_COMMAND_PRINT_CTF_METADATA */
100 /* BT_CONFIG_COMMAND_PRINT_LTTNG_LIVE_SESSIONS */
103 GString
*output_path
;
104 } print_lttng_live_sessions
;
109 struct bt_config_component
*bt_config_get_component(GPtrArray
*array
,
112 struct bt_config_component
*comp
= g_ptr_array_index(array
, index
);
114 bt_object_get_ref(comp
);
118 int bt_config_append_plugin_paths(bt_value
*plugin_paths
,
121 void bt_config_connection_destroy(struct bt_config_connection
*connection
);
123 #endif /* CLI_BABELTRACE_CFG_H */