+static
+const char *component_type_str(enum bt_component_type type)
+{
+ switch (type) {
+ case BT_COMPONENT_TYPE_SOURCE:
+ return "source";
+ case BT_COMPONENT_TYPE_SINK:
+ return "sink";
+ case BT_COMPONENT_TYPE_FILTER:
+ return "filter";
+ case BT_COMPONENT_TYPE_UNKNOWN:
+ default:
+ return "unknown";
+ }
+}
+
+static
+void print_detected_component_classes(struct bt_component_factory *factory)
+{
+ int count, i;
+
+ if (!babeltrace_verbose) {
+ return;
+ }
+
+ count = bt_component_factory_get_component_class_count(factory);
+ if (count <= 0) {
+ fprintf(stderr, "No component classes found. Please make sure your plug-in search path is set correctly.");
+ return;
+ }
+
+ printf_verbose("Found %d component classes.\n", count);
+ for (i = 0; i < count; i++) {
+ struct bt_component_class *component_class =
+ bt_component_factory_get_component_class_index(
+ factory, i);
+ struct bt_plugin *plugin = bt_component_class_get_plugin(
+ component_class);
+ const char *plugin_name = bt_plugin_get_name(plugin);
+ const char *component_name = bt_component_class_get_name(
+ component_class);
+ const char *path = bt_plugin_get_path(plugin);
+ const char *author = bt_plugin_get_author(plugin);
+ const char *license = bt_plugin_get_license(plugin);
+ const char *plugin_description = bt_plugin_get_description(
+ plugin);
+ const char *component_description =
+ bt_component_class_get_description(
+ component_class);
+ enum bt_component_type type = bt_component_class_get_type(
+ component_class);
+
+ printf_verbose("[%s - %s (%s)]\n", plugin_name, component_name,
+ component_type_str(type));
+ printf_verbose("\tpath: %s\n", path);
+ printf_verbose("\tauthor: %s\n", author);
+ printf_verbose("\tlicense: %s\n", license);
+ printf_verbose("\tplugin description: %s\n",
+ plugin_description ? plugin_description : "None");
+ printf_verbose("\tcomponent description: %s\n",
+ component_description ? component_description : "None");
+ }
+}
+
+static
+void test_sink_notifications(struct bt_component *sink)