* Copyright 2010-2011 EfficiOS Inc. and Linux Foundation
*/
+#include <glib.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <babeltrace2/babeltrace.h>
+
#define BT_COMP_LOG_SELF_COMP self_comp
#define BT_LOG_OUTPUT_LEVEL log_level
#define BT_LOG_TAG "PLUGIN/SRC.CTF.FS/META"
#include "logging/comp-logging.h"
-#include <stdio.h>
-#include <stdint.h>
-#include <stdlib.h>
#include "common/assert.h"
-#include <glib.h>
-#include "common/uuid.h"
-#include "compat/memstream.h"
-#include <babeltrace2/babeltrace.h>
-#include "fs.hpp"
+#include "../common/src/metadata/tsdl/decoder.hpp"
#include "file.hpp"
+#include "fs.hpp"
#include "metadata.hpp"
-#include "../common/metadata/decoder.hpp"
-FILE *ctf_fs_metadata_open_file(const char *trace_path)
+FILE *ctf_fs_metadata_open_file(const char *trace_path, bt_logging_level log_level,
+ bt_self_component_class *comp_class)
{
GString *metadata_path;
FILE *fp = NULL;
g_string_append(metadata_path, G_DIR_SEPARATOR_S CTF_FS_METADATA_FILENAME);
fp = fopen(metadata_path->str, "rb");
+ if (!fp) {
+ BT_COMP_CLASS_LOGE_APPEND_CAUSE_ERRNO(comp_class, "Failed to open metadata file",
+ ": path=\"%s\"", metadata_path->str);
+ }
+
g_string_free(metadata_path, TRUE);
+
end:
return fp;
}
return ret;
}
-int ctf_fs_metadata_init(struct ctf_fs_metadata *metadata)
+int ctf_fs_metadata_init(struct ctf_fs_metadata *)
{
/* Nothing to initialize for the moment. */
return 0;