Replace libuuid with internal implementation
[babeltrace.git] / src / lib / trace-ir / clock-snapshot.c
index e2e984113095fade277eaa81153c5ae21ee1101a..307198d2a27c8813098f0feefc204707955469c5 100644 (file)
  * SOFTWARE.
  */
 
-#define BT_LOG_TAG "CLOCK-SNAPSHOT"
-#include "lib/lib-logging.h"
+#define BT_LOG_TAG "LIB/CLOCK-SNAPSHOT"
+#include "lib/logging.h"
 
 #include "lib/assert-pre.h"
-#include "compat/uuid.h"
+#include "common/uuid.h"
 #include "clock-class.h"
 #include "clock-snapshot.h"
 #include <babeltrace2/trace-ir/clock-snapshot-const.h>
@@ -34,6 +34,7 @@
 #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)
@@ -54,7 +55,8 @@ struct bt_clock_snapshot *bt_clock_snapshot_new(
                clock_class);
        ret = g_new0(struct bt_clock_snapshot, 1);
        if (!ret) {
-               BT_LOGE_STR("Failed to allocate one clock snapshot.");
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Failed to allocate one clock snapshot.");
                goto end;
        }
 
@@ -77,7 +79,8 @@ struct bt_clock_snapshot *bt_clock_snapshot_create(
        BT_ASSERT(clock_class);
        clock_snapshot = bt_object_pool_create_object(&clock_class->cs_pool);
        if (!clock_snapshot) {
-               BT_LIB_LOGE("Cannot allocate one clock snapshot from clock class's clock snapshot pool: "
+               BT_LIB_LOGE_APPEND_CAUSE(
+                       "Cannot allocate one clock snapshot from clock class's clock snapshot pool: "
                        "%![cc-]+K", clock_class);
                goto error;
        }
@@ -146,11 +149,12 @@ uint64_t bt_clock_snapshot_get_value(
        return clock_snapshot->value_cycles;
 }
 
-enum bt_clock_snapshot_status bt_clock_snapshot_get_ns_from_origin(
+enum bt_clock_snapshot_get_ns_from_origin_status
+bt_clock_snapshot_get_ns_from_origin(
                const struct bt_clock_snapshot *clock_snapshot,
                int64_t *ret_value_ns)
 {
-       int ret = BT_CLOCK_SNAPSHOT_STATUS_OK;
+       int ret = BT_FUNC_STATUS_OK;
 
        BT_ASSERT_PRE_NON_NULL(clock_snapshot, "Clock snapshot");
        BT_ASSERT_PRE_NON_NULL(ret_value_ns, "Value (ns) (output)");
@@ -161,7 +165,7 @@ enum bt_clock_snapshot_status bt_clock_snapshot_get_ns_from_origin(
                BT_LIB_LOGD("Clock snapshot, once converted to nanoseconds from origin, "
                        "overflows the signed 64-bit integer range: "
                        "%![cs-]+k", clock_snapshot);
-               ret = BT_CLOCK_SNAPSHOT_STATUS_OVERFLOW;
+               ret = BT_FUNC_STATUS_OVERFLOW;
                goto end;
        }
 
This page took 0.029853 seconds and 4 git commands to generate.