+static int cmd_print_lttng_live_sessions(struct bt_config *cfg)
+{
+ printf("TODO\n");
+ return -1;
+}
+
+static int cmd_print_ctf_metadata(struct bt_config *cfg)
+{
+ int ret = 0;
+ struct bt_component_class *comp_cls = NULL;
+ struct bt_value *results = NULL;
+ struct bt_value *params = NULL;
+ struct bt_value *metadata_text_value = NULL;
+ const char *metadata_text = NULL;
+ static const char * const plugin_name = "ctf";
+ static const char * const comp_cls_name = "fs";
+ static const enum bt_component_class_type comp_cls_type =
+ BT_COMPONENT_CLASS_TYPE_SOURCE;
+
+ assert(cfg->cmd_data.print_ctf_metadata.path);
+ comp_cls = find_component_class(plugin_name, comp_cls_name,
+ comp_cls_type);
+ if (!comp_cls) {
+ fprintf(stderr, "%s%sCannot find component class %s",
+ bt_common_color_bold(),
+ bt_common_color_fg_red(),
+ bt_common_color_reset());
+ print_plugin_comp_cls_opt(stderr, plugin_name,
+ comp_cls_name, comp_cls_type);
+ fprintf(stderr, "\n");
+ ret = -1;
+ goto end;
+ }
+
+ params = bt_value_map_create();
+ if (!params) {
+ ret = -1;
+ goto end;
+ }
+
+ ret = bt_value_map_insert_string(params, "path",
+ cfg->cmd_data.print_ctf_metadata.path->str);
+ if (ret) {
+ ret = -1;
+ goto end;
+ }
+
+ results = bt_component_class_query(comp_cls, "metadata-info",
+ params);
+ if (!results) {
+ ret = -1;
+ fprintf(stderr, "%s%sFailed to request metadata info%s\n",
+ bt_common_color_bold(),
+ bt_common_color_fg_red(),
+ bt_common_color_reset());
+ goto end;
+ }
+
+ metadata_text_value = bt_value_map_get(results, "text");
+ if (!metadata_text_value) {
+ ret = -1;
+ goto end;
+ }
+
+ ret = bt_value_string_get(metadata_text_value, &metadata_text);
+ assert(ret == 0);
+ printf("%s\n", metadata_text);
+
+end:
+ bt_put(results);
+ bt_put(params);
+ bt_put(metadata_text_value);
+ bt_put(comp_cls);
+ return 0;
+}
+
+static int cmd_run(struct bt_config *cfg)