src/plugins/ctf/common: restructure subtree
[babeltrace.git] / src / plugins / ctf / fs-src / metadata.cpp
index f428c5e02ff23c7806300538d1c87538a85c6264..021512e8f50b95a85ce3963f1551cee41e5cfe2e 100644 (file)
@@ -5,26 +5,26 @@
  * 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;
@@ -36,7 +36,13 @@ FILE *ctf_fs_metadata_open_file(const char *trace_path)
 
     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;
 }
@@ -116,7 +122,7 @@ end:
     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;
This page took 0.025625 seconds and 4 git commands to generate.