/*
+ * SPDX-License-Identifier: MIT
+ *
* Copyright 2013, 2014 Jérémie Galarneau <jeremie.galarneau@efficios.com>
* Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
- *
- * 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.
*/
#define BT_LOG_TAG "CTF-WRITER/STREAM"
#include "trace.h"
#include "writer.h"
-BT_HIDDEN
void bt_ctf_stream_common_finalize(struct bt_ctf_stream_common *stream)
{
BT_LOGD("Finalizing common stream object: addr=%p, name=\"%s\"",
}
}
-BT_HIDDEN
int bt_ctf_stream_common_initialize(
struct bt_ctf_stream_common *stream,
struct bt_ctf_stream_class_common *stream_class, const char *name,
void update_clock_value(uint64_t *val, uint64_t new_val,
unsigned int new_val_size)
{
- const uint64_t pow2 = 1ULL << new_val_size;
+ const uint64_t pow2 = new_val_size == 64 ? 0 : 1ULL << new_val_size;
const uint64_t mask = pow2 - 1;
uint64_t val_masked;
return ret;
}
-BT_HIDDEN
struct bt_ctf_stream *bt_ctf_stream_create_with_id(
struct bt_ctf_stream_class *stream_class,
const char *name, uint64_t id)
return stream;
}
+BT_EXPORT
struct bt_ctf_stream *bt_ctf_stream_create(
struct bt_ctf_stream_class *stream_class,
const char *name, uint64_t id_param)
name, id_param);
}
+BT_EXPORT
int bt_ctf_stream_get_discarded_events_count(
struct bt_ctf_stream *stream, uint64_t *count)
{
return ret;
}
+BT_EXPORT
void bt_ctf_stream_append_discarded_events(struct bt_ctf_stream *stream,
uint64_t event_count)
{
return ret;
}
+BT_EXPORT
int bt_ctf_stream_append_event(struct bt_ctf_stream *stream,
struct bt_ctf_event *event)
{
return ret;
}
+BT_EXPORT
struct bt_ctf_field *bt_ctf_stream_get_packet_context(struct bt_ctf_stream *stream)
{
struct bt_ctf_field *packet_context = NULL;
return packet_context;
}
+BT_EXPORT
int bt_ctf_stream_set_packet_context(struct bt_ctf_stream *stream,
struct bt_ctf_field *field)
{
return ret;
}
+BT_EXPORT
struct bt_ctf_field *bt_ctf_stream_get_packet_header(struct bt_ctf_stream *stream)
{
struct bt_ctf_field *packet_header = NULL;
return packet_header;
}
+BT_EXPORT
int bt_ctf_stream_set_packet_header(struct bt_ctf_stream *stream,
struct bt_ctf_field *field)
{
}
}
+BT_EXPORT
int bt_ctf_stream_flush(struct bt_ctf_stream *stream)
{
int ret = 0;
* Returns the following codes:
* 1 if the field was found and set,
* 0 if nothing was done (field not found, or was already set),
- * <0 if an error was encoutered
+ * <0 if an error was encountered
*/
static
int try_set_structure_field_integer(struct bt_ctf_field *structure, const char *name,
return _set_structure_field_integer(structure, name, value, BT_CTF_FALSE);
}
+BT_EXPORT
struct bt_ctf_stream_class *bt_ctf_stream_get_class(
struct bt_ctf_stream *stream)
{
return bt_ctf_object_get_ref(bt_ctf_stream_common_borrow_class(BT_CTF_TO_COMMON(stream)));
}
+BT_EXPORT
const char *bt_ctf_stream_get_name(struct bt_ctf_stream *stream)
{
return bt_ctf_stream_common_get_name(BT_CTF_TO_COMMON(stream));
}
+BT_EXPORT
int64_t bt_ctf_stream_get_id(struct bt_ctf_stream *stream)
{
return bt_ctf_stream_common_get_id(BT_CTF_TO_COMMON(stream));