#include <babeltrace/babeltrace.h>
#include <babeltrace/plugin/plugin.h>
#include <babeltrace/component/component.h>
-#include <babeltrace/component/source.h>
-#include <babeltrace/component/sink.h>
-#include <babeltrace/component/filter.h>
+#include <babeltrace/component/component-source.h>
+#include <babeltrace/component/component-sink.h>
+#include <babeltrace/component/component-filter.h>
#include <babeltrace/component/component-class.h>
#include <babeltrace/component/notification/iterator.h>
#include <babeltrace/ref.h>
static
struct bt_component_class *find_component_class(const char *plugin_name,
const char *comp_class_name,
- enum bt_component_type comp_class_type)
+ enum bt_component_class_type comp_class_type)
{
struct bt_component_class *comp_class = NULL;
struct bt_plugin *plugin = find_plugin(plugin_name);
}
static
-const char *component_type_str(enum bt_component_type type)
+const char *component_type_str(enum bt_component_class_type type)
{
switch (type) {
- case BT_COMPONENT_TYPE_SOURCE:
+ case BT_COMPONENT_CLASS_TYPE_SOURCE:
return "source";
- case BT_COMPONENT_TYPE_SINK:
+ case BT_COMPONENT_CLASS_TYPE_SINK:
return "sink";
- case BT_COMPONENT_TYPE_FILTER:
+ case BT_COMPONENT_CLASS_TYPE_FILTER:
return "filter";
- case BT_COMPONENT_TYPE_UNKNOWN:
+ case BT_COMPONENT_CLASS_TYPE_UNKNOWN:
default:
return "unknown";
}
for (i = 0; i < plugins_count; i++) {
int j;
struct bt_plugin *plugin = g_ptr_array_index(loaded_plugins, i);
+ unsigned int major, minor, patch;
+ const char *extra;
+ enum bt_plugin_status version_status;
component_classes_count =
bt_plugin_get_component_class_count(plugin);
+ version_status = bt_plugin_get_version(plugin, &major, &minor,
+ &patch, &extra);
for (j = 0; j < component_classes_count; j++) {
struct bt_component_class *comp_class =
bt_plugin_get_description(plugin);
const char *comp_class_description =
bt_component_class_get_description(comp_class);
- enum bt_component_type type =
+ enum bt_component_class_type type =
bt_component_class_get_type(comp_class);
printf_verbose("[%s - %s (%s)]\n", plugin_name,
license ? license : "Unknown");
printf_verbose("\tplugin description: %s\n",
plugin_description ? plugin_description : "None");
+
+ if (version_status == BT_PLUGIN_STATUS_OK) {
+ printf_verbose("\tplugin version: %u.%u.%u",
+ major, minor, patch);
+
+ if (extra) {
+ printf("%s", extra);
+ }
+
+ printf("\n");
+ }
+
printf_verbose("\tcomponent description: %s\n",
comp_class_description ? comp_class_description : "None");
bt_put(comp_class);
}
trimmer_class = find_component_class("utils", "trimmer",
- BT_COMPONENT_TYPE_FILTER);
+ BT_COMPONENT_CLASS_TYPE_FILTER);
if (!trimmer_class) {
fprintf(stderr, "Could not find trimmer component class. Aborting...\n");
goto end;
struct bt_notification_iterator *source_it = NULL;
struct bt_notification_iterator *to_sink_it = NULL;
- source_it = bt_component_source_create_iterator(source);
+ source_it = bt_component_source_create_notification_iterator(source);
if (!source_it) {
fprintf(stderr, "Failed to instantiate source iterator. Aborting...\n");
ret = -1;
goto end;
}
- to_sink_it = bt_component_filter_create_iterator(trimmer);
+ to_sink_it = bt_component_filter_create_notification_iterator(trimmer);
if (!to_sink_it) {
fprintf(stderr, "Failed to instantiate trimmer iterator. Aborting...\n");
ret = -1;
continue;
}
- plugins = bt_plugin_create_all_from_dir(plugin_path, true);
+ plugins = bt_plugin_create_all_from_dir(plugin_path, false);
if (!plugins) {
printf_debug("Unable to dynamically load plugins from path %s.\n",
plugin_path);
source_params = bt_get(source_cfg->params);
source_class = find_component_class(source_cfg->plugin_name->str,
source_cfg->component_name->str,
- BT_COMPONENT_TYPE_SOURCE);
+ BT_COMPONENT_CLASS_TYPE_SOURCE);
if (!source_class) {
fprintf(stderr, "Could not find %s.%s source component class. Aborting...\n",
source_cfg->plugin_name->str,
sink_params = bt_get(sink_cfg->params);
sink_class = find_component_class(sink_cfg->plugin_name->str,
sink_cfg->component_name->str,
- BT_COMPONENT_TYPE_SINK);
+ BT_COMPONENT_CLASS_TYPE_SINK);
if (!sink_class) {
fprintf(stderr, "Could not find %s.%s output component class. Aborting...\n",
sink_cfg->plugin_name->str,