/*
- * Copyright 2016 - Philippe Proulx <pproulx@efficios.com>
- * Copyright 2010-2011 - EfficiOS Inc. and Linux Foundation
+ * SPDX-License-Identifier: MIT
*
- * Some functions are based on older functions written by Mathieu Desnoyers.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Copyright 2016 Philippe Proulx <pproulx@efficios.com>
+ * Copyright 2010-2011 EfficiOS Inc. and Linux Foundation
*/
#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 "plugins/comp-logging.h"
+#include "logging/comp-logging.h"
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
-#include <stdbool.h>
#include "common/assert.h"
#include <glib.h>
#include "common/uuid.h"
.self_comp = self_comp,
.clock_class_offset_s = config ? config->clock_class_offset_s : 0,
.clock_class_offset_ns = config ? config->clock_class_offset_ns : 0,
+ .force_clock_class_origin_unix_epoch =
+ config ? config->force_clock_class_origin_unix_epoch : false,
+ .create_trace_class = true,
};
bt_logging_level log_level = ctf_fs_trace->log_level;
file = get_file(ctf_fs_trace->path->str, log_level, self_comp);
if (!file) {
- BT_COMP_LOGE("Cannot create metadata file object");
+ BT_COMP_LOGE("Cannot create metadata file object.");
ret = -1;
goto end;
}
ctf_fs_trace->metadata->decoder = ctf_metadata_decoder_create(
&decoder_config);
if (!ctf_fs_trace->metadata->decoder) {
- BT_COMP_LOGE("Cannot create metadata decoder object");
+ BT_COMP_LOGE("Cannot create metadata decoder object.");
ret = -1;
goto end;
}
- ret = ctf_metadata_decoder_decode(ctf_fs_trace->metadata->decoder,
- file->fp);
+ ret = ctf_metadata_decoder_append_content(
+ ctf_fs_trace->metadata->decoder, file->fp);
if (ret) {
- BT_COMP_LOGE("Cannot decode metadata file");
+ BT_COMP_LOGE("Cannot update metadata decoder's content.");
goto end;
}
BT_HIDDEN
void ctf_fs_metadata_fini(struct ctf_fs_metadata *metadata)
{
- if (metadata->text) {
- free(metadata->text);
- }
+ free(metadata->text);
if (metadata->trace_class) {
BT_TRACE_CLASS_PUT_REF_AND_RESET(metadata->trace_class);