X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=src%2Fplugins%2Fctf%2Fcommon%2Fmetadata%2Fdecoder.h;h=58fccc016f39ffccc9c765bda4ae13f5261d7115;hp=f67548998751998555a92795e98c78f5bc06055d;hb=0235b0db7de5bcacdb3650c92461f2ce5eb2143d;hpb=06be99464988953e390114337ccdd20622fb50d1 diff --git a/src/plugins/ctf/common/metadata/decoder.h b/src/plugins/ctf/common/metadata/decoder.h index f6754899..58fccc01 100644 --- a/src/plugins/ctf/common/metadata/decoder.h +++ b/src/plugins/ctf/common/metadata/decoder.h @@ -1,20 +1,12 @@ -#ifndef _METADATA_DECODER_H -#define _METADATA_DECODER_H - /* - * Copyright 2016-2017 - Philippe Proulx - * - * 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: + * SPDX-License-Identifier: MIT * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. + * Copyright 2016-2017 Philippe Proulx */ +#ifndef _METADATA_DECODER_H +#define _METADATA_DECODER_H + #include #include @@ -31,6 +23,7 @@ struct ctf_metadata_decoder; /* CTF metadata decoder status */ enum ctf_metadata_decoder_status { CTF_METADATA_DECODER_STATUS_OK = 0, + CTF_METADATA_DECODER_STATUS_NONE = 1, CTF_METADATA_DECODER_STATUS_ERROR = -1, CTF_METADATA_DECODER_STATUS_INCOMPLETE = -2, CTF_METADATA_DECODER_STATUS_INVAL_VERSION = -3, @@ -48,6 +41,7 @@ struct ctf_metadata_decoder_config { /* Additional clock class offset to apply */ int64_t clock_class_offset_s; int64_t clock_class_offset_ns; + bool force_clock_class_origin_unix_epoch; /* True to create trace class objects */ bool create_trace_class; @@ -148,12 +142,23 @@ int ctf_metadata_decoder_get_byte_order(struct ctf_metadata_decoder *mdec); /* * Returns the UUID of the decoder's metadata stream as set by the last * call to ctf_metadata_decoder_append_content(). + */ +BT_HIDDEN +int ctf_metadata_decoder_get_uuid( + struct ctf_metadata_decoder *mdec, bt_uuid_t uuid); + +/* + * Returns the UUID of the decoder's trace class, if available. * - * Returns -1 if unknown (plain text content). + * Returns: + * + * * `CTF_METADATA_DECODER_STATUS_OK`: success. + * * `CTF_METADATA_DECODER_STATUS_NONE`: no UUID. + * * `CTF_METADATA_DECODER_STATUS_INCOMPLETE`: missing metadata content. */ BT_HIDDEN -int ctf_metadata_decoder_get_uuid(struct ctf_metadata_decoder *mdec, - bt_uuid_t uuid); +enum ctf_metadata_decoder_status ctf_metadata_decoder_get_trace_class_uuid( + struct ctf_metadata_decoder *mdec, bt_uuid_t uuid); /* * Returns the metadata decoder's current metadata text.