From b37345369d0a5a8d31934d1edb76f723a88f0038 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Thu, 7 Feb 2019 13:47:02 -0500 Subject: [PATCH] lib: remove CV snapshot property from stream beginning/end message The beginning and end times of a given stream will be given by another type of message implemented in a subsequent patch. Signed-off-by: Philippe Proulx --- .../babeltrace/graph/message-stream-const.h | 8 -- .../graph/message-stream-internal.h | 2 - include/babeltrace/graph/message-stream.h | 6 -- lib/graph/message/stream.c | 81 ------------------- 4 files changed, 97 deletions(-) diff --git a/include/babeltrace/graph/message-stream-const.h b/include/babeltrace/graph/message-stream-const.h index a7bf8d7b..fbac5962 100644 --- a/include/babeltrace/graph/message-stream-const.h +++ b/include/babeltrace/graph/message-stream-const.h @@ -37,17 +37,9 @@ extern "C" { extern const bt_stream *bt_message_stream_beginning_borrow_stream_const( const bt_message *message); -extern bt_clock_snapshot_state -bt_message_stream_beginning_borrow_default_clock_snapshot_const( - const bt_message *msg, const bt_clock_snapshot **snapshot); - extern const bt_stream *bt_message_stream_end_borrow_stream_const( const bt_message *message); -extern bt_clock_snapshot_state -bt_message_stream_end_borrow_default_clock_snapshot_const( - const bt_message *msg, const bt_clock_snapshot **snapshot); - #ifdef __cplusplus } #endif diff --git a/include/babeltrace/graph/message-stream-internal.h b/include/babeltrace/graph/message-stream-internal.h index 3752c109..36e4580c 100644 --- a/include/babeltrace/graph/message-stream-internal.h +++ b/include/babeltrace/graph/message-stream-internal.h @@ -33,13 +33,11 @@ struct bt_message_stream_beginning { struct bt_message parent; struct bt_stream *stream; - struct bt_clock_snapshot *default_cs; }; struct bt_message_stream_end { struct bt_message parent; struct bt_stream *stream; - struct bt_clock_snapshot *default_cs; }; #endif /* BABELTRACE_GRAPH_MESSAGE_STREAM_INTERNAL_H */ diff --git a/include/babeltrace/graph/message-stream.h b/include/babeltrace/graph/message-stream.h index e810a661..e12b9090 100644 --- a/include/babeltrace/graph/message-stream.h +++ b/include/babeltrace/graph/message-stream.h @@ -44,15 +44,9 @@ bt_message *bt_message_stream_end_create( extern bt_stream *bt_message_stream_beginning_borrow_stream( bt_message *message); -extern void bt_message_stream_beginning_set_default_clock_snapshot( - bt_message *msg, uint64_t value_cycles); - extern bt_stream *bt_message_stream_end_borrow_stream( bt_message *message); -extern void bt_message_stream_end_set_default_clock_snapshot( - bt_message *msg, uint64_t value_cycles); - #ifdef __cplusplus } #endif diff --git a/lib/graph/message/stream.c b/lib/graph/message/stream.c index 2bfa5600..0d6f374c 100644 --- a/lib/graph/message/stream.c +++ b/lib/graph/message/stream.c @@ -46,12 +46,6 @@ void bt_message_stream_end_destroy(struct bt_object *obj) message); BT_LIB_LOGD("Putting stream: %!+s", message->stream); BT_OBJECT_PUT_REF_AND_RESET(message->stream); - - if (message->default_cs) { - bt_clock_snapshot_recycle(message->default_cs); - message->default_cs = NULL; - } - g_free(message); } @@ -107,40 +101,6 @@ const struct bt_stream *bt_message_stream_end_borrow_stream_const( (void *) message); } -void bt_message_stream_end_set_default_clock_snapshot( - struct bt_message *msg, uint64_t value_cycles) -{ - struct bt_message_stream_end *se_msg = (void *) msg; - - BT_ASSERT_PRE_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_HOT(msg, "Message", ": %!+n", msg); - BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_STREAM_END); - BT_ASSERT_PRE(se_msg->stream->class->default_clock_class, - "Message's stream class has no default clock class: " - "%![msg-]+n, %![sc-]+S", msg, se_msg->stream->class); - - /* TODO: have the object already created */ - se_msg->default_cs = bt_clock_snapshot_create( - se_msg->stream->class->default_clock_class); - BT_ASSERT(se_msg->default_cs); - bt_clock_snapshot_set_raw_value(se_msg->default_cs, value_cycles); - BT_LIB_LOGV("Set message's default clock snapshot: %![msg-]+n, " - "value=%" PRIu64, value_cycles); -} - -enum bt_clock_snapshot_state -bt_message_stream_end_borrow_default_clock_snapshot_const( - const bt_message *msg, const bt_clock_snapshot **snapshot) -{ - struct bt_message_stream_end *stream_end = (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_STREAM_END); - *snapshot = stream_end->default_cs; - return BT_CLOCK_SNAPSHOT_STATE_KNOWN; -} - static void bt_message_stream_beginning_destroy(struct bt_object *obj) { @@ -151,12 +111,6 @@ void bt_message_stream_beginning_destroy(struct bt_object *obj) message); BT_LIB_LOGD("Putting stream: %!+s", message->stream); BT_OBJECT_PUT_REF_AND_RESET(message->stream); - - if (message->default_cs) { - bt_clock_snapshot_recycle(message->default_cs); - message->default_cs = NULL; - } - g_free(message); } @@ -210,38 +164,3 @@ const struct bt_stream *bt_message_stream_beginning_borrow_stream_const( return bt_message_stream_beginning_borrow_stream( (void *) message); } - -void bt_message_stream_beginning_set_default_clock_snapshot( - struct bt_message *msg, - uint64_t value_cycles) -{ - struct bt_message_stream_beginning *sb_msg = (void *) msg; - - BT_ASSERT_PRE_NON_NULL(msg, "Message"); - BT_ASSERT_PRE_HOT(msg, "Message", ": %!+n", msg); - BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_STREAM_BEGINNING); - BT_ASSERT_PRE(sb_msg->stream->class->default_clock_class, - "Message's stream class has no default clock class: " - "%![msg-]+n, %![sc-]+S", msg, sb_msg->stream->class); - - /* TODO: have the object already created */ - sb_msg->default_cs = bt_clock_snapshot_create( - sb_msg->stream->class->default_clock_class); - BT_ASSERT(sb_msg->default_cs); - bt_clock_snapshot_set_raw_value(sb_msg->default_cs, value_cycles); - BT_LIB_LOGV("Set message's default clock snapshot: %![msg-]+n, " - "value=%" PRIu64, value_cycles); -} - -enum bt_clock_snapshot_state -bt_message_stream_beginning_borrow_default_clock_snapshot_const( - const bt_message *msg, const bt_clock_snapshot **snapshot) -{ - struct bt_message_stream_beginning *stream_beginning = (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_STREAM_END); - *snapshot = stream_beginning->default_cs; - return BT_CLOCK_SNAPSHOT_STATE_KNOWN; -} -- 2.34.1