*/
#include <babeltrace/common-internal.h>
-#include <babeltrace/ctf-ir/packet.h>
-#include <babeltrace/ctf-ir/clock-class.h>
-#include <babeltrace/ctf-ir/stream.h>
-#include <babeltrace/ctf-ir/fields.h>
-#include <babeltrace/graph/private-port.h>
-#include <babeltrace/graph/private-component.h>
-#include <babeltrace/graph/private-component-source.h>
-#include <babeltrace/graph/private-notification-iterator.h>
-#include <babeltrace/graph/component.h>
-#include <babeltrace/graph/notification-iterator.h>
-#include <babeltrace/graph/clock-class-priority-map.h>
+#include <babeltrace/babeltrace.h>
#include <plugins-common.h>
#include <glib.h>
#include <assert.h>
g_free(notif_iter_data);
}
-struct bt_notification_iterator_next_return ctf_fs_iterator_next(
- struct bt_private_notification_iterator *iterator)
+struct bt_notification_iterator_next_method_return ctf_fs_iterator_next(
+ struct bt_private_connection_private_notification_iterator *iterator)
{
- struct bt_notification_iterator_next_return next_ret;
+ struct bt_notification_iterator_next_method_return next_ret;
struct ctf_fs_notif_iter_data *notif_iter_data =
- bt_private_notification_iterator_get_user_data(iterator);
+ bt_private_connection_private_notification_iterator_get_user_data(iterator);
int ret;
assert(notif_iter_data->ds_file);
return next_ret;
}
-void ctf_fs_iterator_finalize(struct bt_private_notification_iterator *it)
+void ctf_fs_iterator_finalize(struct bt_private_connection_private_notification_iterator *it)
{
void *notif_iter_data =
- bt_private_notification_iterator_get_user_data(it);
+ bt_private_connection_private_notification_iterator_get_user_data(it);
ctf_fs_notif_iter_data_destroy(notif_iter_data);
}
enum bt_notification_iterator_status ctf_fs_iterator_init(
- struct bt_private_notification_iterator *it,
+ struct bt_private_connection_private_notification_iterator *it,
struct bt_private_port *port)
{
struct ctf_fs_port_data *port_data;
goto error;
}
- ret = bt_private_notification_iterator_set_user_data(it, notif_iter_data);
+ ret = bt_private_connection_private_notification_iterator_set_user_data(it, notif_iter_data);
if (ret != BT_NOTIFICATION_ITERATOR_STATUS_OK) {
goto error;
}
goto end;
error:
- (void) bt_private_notification_iterator_set_user_data(it, NULL);
+ (void) bt_private_connection_private_notification_iterator_set_user_data(it, NULL);
end:
ctf_fs_notif_iter_data_destroy(notif_iter_data);
if (!strcmp(basename, CTF_FS_METADATA_FILENAME)) {
/* Ignore the metadata stream. */
- BT_LOGD("Ignoring metadata file `%s/%s`",
+ BT_LOGD("Ignoring metadata file `%s" G_DIR_SEPARATOR_S "%s`",
ctf_fs_trace->path->str, basename);
continue;
}
if (basename[0] == '.') {
- BT_LOGD("Ignoring hidden file `%s/%s`",
+ BT_LOGD("Ignoring hidden file `%s" G_DIR_SEPARATOR_S "%s`",
ctf_fs_trace->path->str, basename);
continue;
}
/* Create the file. */
file = ctf_fs_file_create();
if (!file) {
- BT_LOGE("Cannot create stream file object for file `%s/%s`",
+ BT_LOGE("Cannot create stream file object for file `%s" G_DIR_SEPARATOR_S "%s`",
ctf_fs_trace->path->str, basename);
goto error;
}
/* Create full path string. */
- g_string_append_printf(file->path, "%s/%s",
+ g_string_append_printf(file->path, "%s" G_DIR_SEPARATOR_S "%s",
ctf_fs_trace->path->str, basename);
if (!g_file_test(file->path->str, G_FILE_TEST_IS_REGULAR)) {
BT_LOGD("Ignoring non-regular file `%s`",
goto end;
}
- g_string_printf(metadata_path, "%s/%s", path, CTF_FS_METADATA_FILENAME);
+ g_string_printf(metadata_path, "%s" G_DIR_SEPARATOR_S "%s", path, CTF_FS_METADATA_FILENAME);
if (g_file_test(metadata_path->str, G_FILE_TEST_IS_REGULAR)) {
ret = 1;
goto end;
}
+ // FIXME: Remove or ifdef for __MINGW32__
if (strcmp(norm_path->str, "/") == 0) {
BT_LOGE("Opening a trace in `/` is not supported.");
ret = -1;
goto end;
}
- g_string_printf(sub_path, "%s/%s", start_path, basename);
+ g_string_printf(sub_path, "%s" G_DIR_SEPARATOR_S "%s", start_path, basename);
ret = ctf_fs_find_traces(trace_paths, sub_path->str);
g_string_free(sub_path, TRUE);
if (ret) {
}
BT_HIDDEN
-struct bt_value *ctf_fs_query(struct bt_component_class *comp_class,
+struct bt_component_class_query_method_return ctf_fs_query(
+ struct bt_component_class *comp_class,
+ struct bt_query_executor *query_exec,
const char *object, struct bt_value *params)
{
- struct bt_value *result = NULL;
+ struct bt_component_class_query_method_return ret = {
+ .result = NULL,
+ .status = BT_QUERY_STATUS_OK,
+ };
if (!strcmp(object, "metadata-info")) {
- result = metadata_info_query(comp_class, params);
+ ret = metadata_info_query(comp_class, params);
} else if (!strcmp(object, "trace-info")) {
- result = trace_info_query(comp_class, params);
+ ret = trace_info_query(comp_class, params);
} else {
BT_LOGE("Unknown query object `%s`", object);
+ ret.status = BT_QUERY_STATUS_INVALID_OBJECT;
goto end;
}
end:
- return result;
+ return ret;
}