#include "lib/logging.h"
#include "lib/assert-cond.h"
-#include "common/uuid.h"
#include "clock-class.h"
#include "clock-snapshot.h"
#include <babeltrace2/trace-ir/clock-snapshot.h>
#include "compat/compiler.h"
#include <babeltrace2/types.h>
#include "compat/string.h"
-#include <inttypes.h>
#include "lib/object.h"
#include "common/assert.h"
#include "lib/func-status.h"
-BT_HIDDEN
void bt_clock_snapshot_destroy(struct bt_clock_snapshot *clock_snapshot)
{
BT_ASSERT(clock_snapshot);
g_free(clock_snapshot);
}
-BT_HIDDEN
struct bt_clock_snapshot *bt_clock_snapshot_new(
struct bt_clock_class *clock_class)
{
return ret;
}
-BT_HIDDEN
struct bt_clock_snapshot *bt_clock_snapshot_create(
struct bt_clock_class *clock_class)
{
return clock_snapshot;
}
-BT_HIDDEN
void bt_clock_snapshot_recycle(struct bt_clock_snapshot *clock_snapshot)
{
struct bt_clock_class *clock_class;
bt_object_put_ref(clock_class);
}
+BT_EXPORT
uint64_t bt_clock_snapshot_get_value(
const struct bt_clock_snapshot *clock_snapshot)
{
- BT_ASSERT_PRE_DEV_NON_NULL(clock_snapshot, "Clock snapshot");
- BT_ASSERT_PRE_DEV(clock_snapshot->is_set,
- "Clock snapshot is not set: %!+k", clock_snapshot);
+ BT_ASSERT_PRE_DEV_CS_NON_NULL(clock_snapshot);
+ BT_ASSERT_DBG(clock_snapshot->is_set);
return clock_snapshot->value_cycles;
}
+BT_EXPORT
enum bt_clock_snapshot_get_ns_from_origin_status
bt_clock_snapshot_get_ns_from_origin(
const struct bt_clock_snapshot *clock_snapshot,
int ret = BT_FUNC_STATUS_OK;
BT_ASSERT_PRE_DEV_NO_ERROR();
- BT_ASSERT_PRE_DEV_NON_NULL(clock_snapshot, "Clock snapshot");
- BT_ASSERT_PRE_DEV_NON_NULL(ret_value_ns, "Value (ns) (output)");
- BT_ASSERT_PRE_DEV(clock_snapshot->is_set,
- "Clock snapshot is not set: %!+k", clock_snapshot);
+ BT_ASSERT_PRE_DEV_CS_NON_NULL(clock_snapshot);
+ BT_ASSERT_PRE_DEV_NON_NULL("value-ns-output", ret_value_ns,
+ "Value (ns) (output)");
+ BT_ASSERT_DBG(clock_snapshot->is_set);
if (clock_snapshot->ns_from_origin_overflows) {
BT_LIB_LOGE_APPEND_CAUSE(
return ret;
}
+BT_EXPORT
const struct bt_clock_class *bt_clock_snapshot_borrow_clock_class_const(
const struct bt_clock_snapshot *clock_snapshot)
{
- BT_ASSERT_PRE_DEV_NON_NULL(clock_snapshot, "Clock snapshot");
+ BT_ASSERT_PRE_DEV_CS_NON_NULL(clock_snapshot);
return clock_snapshot->clock_class;
}