From 59e3c4db009ddcef01ad326567d86841acb8e2d2 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 7 Aug 2018 19:32:16 -0400 Subject: [PATCH] Fix: lib: do not check the frozen state in bt_X_set_is_frozen() Some freezing functions were called bt_X_freeze() and were transformed into freezing/thawing functions bt_X_set_is_frozen(), accepting the frozen state as a parameter. The optimization checks to avoid refreezing when the object is already frozen were left, but we can thaw now, so we must not check this. It could be optimized again, but those specific freezing functions are only enabled in developer mode, so it's not a complete catastrophe. Signed-off-by: Philippe Proulx --- lib/ctf-ir/event.c | 5 ----- lib/ctf-ir/fields.c | 4 ---- lib/ctf-ir/packet.c | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/ctf-ir/event.c b/lib/ctf-ir/event.c index 9337c4b3c..115158c3e 100644 --- a/lib/ctf-ir/event.c +++ b/lib/ctf-ir/event.c @@ -282,11 +282,6 @@ void _bt_event_common_set_is_frozen(struct bt_event_common *event, bool is_frozen) { BT_ASSERT(event); - - if (event->frozen) { - return; - } - BT_LOGD("Freezing event: addr=%p, " "event-class-name=\"%s\", event-class-id=%" PRId64, event, bt_event_class_common_get_name(event->class), diff --git a/lib/ctf-ir/fields.c b/lib/ctf-ir/fields.c index 7ed1d7384..d235f1b45 100644 --- a/lib/ctf-ir/fields.c +++ b/lib/ctf-ir/fields.c @@ -1218,10 +1218,6 @@ void _bt_field_common_set_is_frozen_recursive(struct bt_field_common *field, goto end; } - if (field->frozen) { - goto end; - } - BT_LOGD("Setting field object's frozen state: addr=%p, is-frozen=%d", field, is_frozen); BT_ASSERT(field_type_common_has_known_id(field->type)); diff --git a/lib/ctf-ir/packet.c b/lib/ctf-ir/packet.c index ad09416bc..8a8926697 100644 --- a/lib/ctf-ir/packet.c +++ b/lib/ctf-ir/packet.c @@ -64,7 +64,7 @@ struct bt_field *bt_packet_borrow_context(struct bt_packet *packet) BT_HIDDEN void _bt_packet_set_is_frozen(struct bt_packet *packet, bool is_frozen) { - if (!packet || packet->frozen) { + if (!packet) { return; } -- 2.34.1