#include <babeltrace/object-internal.h>
#include <babeltrace/compiler-internal.h>
#include <babeltrace/trace-ir/clock-class.h>
-#include <babeltrace/trace-ir/clock-value-internal.h>
+#include <babeltrace/trace-ir/clock-snapshot-internal.h>
#include <babeltrace/graph/message-internal.h>
#include <babeltrace/graph/message-inactivity-const.h>
#include <babeltrace/graph/message-inactivity.h>
BT_LIB_LOGD("Destroying inactivity message: %!+n", message);
- if (message->default_cv) {
- bt_clock_value_recycle(message->default_cv);
+ if (message->default_cs) {
+ bt_clock_snapshot_recycle(message->default_cs);
}
g_free(message);
BT_MESSAGE_TYPE_INACTIVITY,
bt_message_inactivity_destroy, NULL);
ret_msg = &message->parent;
- message->default_cv = bt_clock_value_create(default_clock_class);
- if (!message->default_cv) {
+ message->default_cs = bt_clock_snapshot_create(default_clock_class);
+ if (!message->default_cs) {
goto error;
}
return (void *) ret_msg;
}
-void bt_message_inactivity_set_default_clock_value(
+void bt_message_inactivity_set_default_clock_snapshot(
struct bt_message *msg, uint64_t value_cycles)
{
struct bt_message_inactivity *inactivity = (void *) msg;
BT_ASSERT_PRE_NON_NULL(msg, "Message");
BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_INACTIVITY);
BT_ASSERT_PRE_HOT(msg, "Message", ": %!+n", msg);
- bt_clock_value_set_value_inline(inactivity->default_cv, value_cycles);
- BT_LIB_LOGV("Set inactivity message's default clock value: "
+ bt_clock_snapshot_set_value_inline(inactivity->default_cs, value_cycles);
+ BT_LIB_LOGV("Set inactivity message's default clock snapshot: "
"%![msg-]+n, value=%" PRIu64, msg, value_cycles);
}
-const struct bt_clock_value *
-bt_message_inactivity_borrow_default_clock_value_const(
- const struct bt_message *msg)
+extern enum bt_clock_snapshot_state
+bt_message_inactivity_borrow_default_clock_snapshot_const(
+ const bt_message *msg, const bt_clock_snapshot **snapshot)
{
struct bt_message_inactivity *inactivity = (void *) msg;
BT_ASSERT_PRE_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_NON_NULL(snapshot, "Clock snapshot (output)");
BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_INACTIVITY);
- return inactivity->default_cv;
+ *snapshot = inactivity->default_cs;
+ return BT_CLOCK_SNAPSHOT_STATE_KNOWN;
}