X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lib%2Ftrace-ir%2Fclock-snapshot.c;fp=lib%2Ftrace-ir%2Fclock-snapshot.c;h=792b3fc08bd7ebfcdcd5b22d228a5754339d7cf3;hb=dc68f16da7c8a96930d36f50489d6697c852b733;hp=7dcf2893fac2f0b0123f12b582c8a5f8d9560505;hpb=8c41fd73456a0645bb1798174e49b882d4f7bff7;p=babeltrace.git diff --git a/lib/trace-ir/clock-snapshot.c b/lib/trace-ir/clock-snapshot.c index 7dcf2893..792b3fc0 100644 --- a/lib/trace-ir/clock-snapshot.c +++ b/lib/trace-ir/clock-snapshot.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -142,10 +143,12 @@ uint64_t bt_clock_snapshot_get_value(const struct bt_clock_snapshot *clock_snaps return clock_snapshot->value_cycles; } -int bt_clock_snapshot_get_ns_from_origin(const struct bt_clock_snapshot *clock_snapshot, +enum bt_clock_snapshot_status bt_clock_snapshot_get_ns_from_origin( + const struct bt_clock_snapshot *clock_snapshot, int64_t *ret_value_ns) { - int ret = 0; + int ret = BT_CLOCK_SNAPSHOT_STATUS_OK; + BT_ASSERT_PRE_NON_NULL(clock_snapshot, "Clock snapshot"); BT_ASSERT_PRE_NON_NULL(ret_value_ns, "Value (ns) (output)"); BT_ASSERT_PRE(clock_snapshot->is_set, @@ -155,7 +158,7 @@ int bt_clock_snapshot_get_ns_from_origin(const struct bt_clock_snapshot *clock_s BT_LIB_LOGD("Clock snapshot, once converted to nanoseconds from origin, " "overflows the signed 64-bit integer range: " "%![cs-]+k", clock_snapshot); - ret = -1; + ret = BT_CLOCK_SNAPSHOT_STATUS_OVERFLOW; goto end; }