lib: create_packet_message(): make assertion message less convoluted
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 3 Jun 2019 15:33:49 +0000 (11:33 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 6 Jun 2019 21:19:12 +0000 (17:19 -0400)
Instead of having a message which enumerated the possible precondition
breaks, have it say that the stream class has an unexpected configuration,
and add the "packets have default beginning clock snapshot" and
"packets have default end clock snapshot" properties to the extended
logging of a stream class object in `lib-logging.c`.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ic7b706b9d6ef3afb799072a8891a0ba24370f317
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1364
Tested-by: jenkins
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
lib/graph/message/packet.c
lib/lib-logging.c

index fe660531d9c4f58014de46eee49d586ec421b41b..94047895e127cab7f42ba376a439b8d65b378a6e 100644 (file)
@@ -110,9 +110,8 @@ struct bt_message *create_packet_message(
         */
        BT_ASSERT_PRE((with_cs && packet_has_default_clock_snapshot) ||
                (!with_cs && !packet_has_default_clock_snapshot),
-               "Creating a packet message with a default clock snapshot, but without "
-               "a default clock class, or without a default clock snapshot, "
-               "but with a default clock class: ",
+               "Unexpected stream class configuration when creating "
+               "a packet beginning or end message: ",
                "%![stream-]+s, %![sc-]+S, with-cs=%d, "
                "cs-val=%" PRIu64,
                stream, stream_class, with_cs, raw_value);
index 98572f161d4a8a5b2d9c1fd574f2d71ac4a8d887..683df22eb2d009d1b968f611e18bde28fa85dc61 100644 (file)
@@ -534,9 +534,13 @@ static inline void format_stream_class(char **buf_ch, bool extended,
                return;
        }
 
-       BUF_APPEND(", %sassigns-auto-ec-id=%d, %sassigns-auto-stream-id=%d",
+       BUF_APPEND(", %sassigns-auto-ec-id=%d, %sassigns-auto-stream-id=%d, "
+               "%spackets-have-default-beginning-cs=%d, "
+               "%spackets-have-default-end-cs=%d, ",
                PRFIELD(stream_class->assigns_automatic_event_class_id),
-               PRFIELD(stream_class->assigns_automatic_stream_id));
+               PRFIELD(stream_class->assigns_automatic_stream_id),
+               PRFIELD(stream_class->packets_have_default_beginning_clock_snapshot),
+               PRFIELD(stream_class->packets_have_default_end_clock_snapshot));
        BUF_APPEND(", %strace-class-addr=%p", PRFIELD(trace_class));
        SET_TMP_PREFIX("trace-class-");
        format_trace_class(buf_ch, false, tmp_prefix, trace_class);
This page took 0.025579 seconds and 4 git commands to generate.