lib: make packets and packet messages optional, disabled by default
[babeltrace.git] / src / plugins / text / details / write.c
index e79e7e03ef2d2f78896af2f5b6a877ad3ac22f53..1606599c28fec3a9c751fadf1de30d01b120df16 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "common/assert.h"
 #include "common/common.h"
+#include "common/uuid.h"
 #include "details.h"
 #include "write.h"
 #include "obj-lifetime-mgmt.h"
@@ -329,24 +330,9 @@ void write_uuid_prop_line(struct details_write_ctx *ctx, const char *prop_name,
        write_indent(ctx);
        write_prop_name(ctx, prop_name);
        g_string_append_printf(ctx->str,
-               ": %s%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%s\n",
+               ": %s" BT_UUID_FMT "%s\n",
                color_bold(ctx),
-               (unsigned int) uuid[0],
-               (unsigned int) uuid[1],
-               (unsigned int) uuid[2],
-               (unsigned int) uuid[3],
-               (unsigned int) uuid[4],
-               (unsigned int) uuid[5],
-               (unsigned int) uuid[6],
-               (unsigned int) uuid[7],
-               (unsigned int) uuid[8],
-               (unsigned int) uuid[9],
-               (unsigned int) uuid[10],
-               (unsigned int) uuid[11],
-               (unsigned int) uuid[12],
-               (unsigned int) uuid[13],
-               (unsigned int) uuid[14],
-               (unsigned int) uuid[15],
+               BT_UUID_FMT_VALUES(uuid),
                color_reset(ctx));
 }
 
@@ -1039,23 +1025,36 @@ void write_stream_class(struct details_write_ctx *ctx,
 
        /* Write configuration */
        write_bool_prop_line(ctx,
-               "Packets have beginning default clock snapshot",
-               bt_stream_class_packets_have_beginning_default_clock_snapshot(sc));
-       write_bool_prop_line(ctx,
-               "Packets have end default clock snapshot",
-               bt_stream_class_packets_have_end_default_clock_snapshot(sc));
+               "Supports packets", bt_stream_class_supports_packets(sc));
+
+       if (bt_stream_class_supports_packets(sc)) {
+               write_bool_prop_line(ctx,
+                       "Packets have beginning default clock snapshot",
+                       bt_stream_class_packets_have_beginning_default_clock_snapshot(sc));
+               write_bool_prop_line(ctx,
+                       "Packets have end default clock snapshot",
+                       bt_stream_class_packets_have_end_default_clock_snapshot(sc));
+       }
+
        write_bool_prop_line(ctx,
                "Supports discarded events",
                bt_stream_class_supports_discarded_events(sc));
-       write_bool_prop_line(ctx,
-               "Discarded events have default clock snapshots",
-               bt_stream_class_discarded_events_have_default_clock_snapshots(sc));
+
+       if (bt_stream_class_supports_discarded_events(sc)) {
+               write_bool_prop_line(ctx,
+                       "Discarded events have default clock snapshots",
+                       bt_stream_class_discarded_events_have_default_clock_snapshots(sc));
+       }
+
        write_bool_prop_line(ctx,
                "Supports discarded packets",
                bt_stream_class_supports_discarded_packets(sc));
-       write_bool_prop_line(ctx,
-               "Discarded packets have default clock snapshots",
-               bt_stream_class_discarded_packets_have_default_clock_snapshots(sc));
+
+       if (bt_stream_class_supports_discarded_packets(sc)) {
+               write_bool_prop_line(ctx,
+                       "Discarded packets have default clock snapshots",
+                       bt_stream_class_discarded_packets_have_default_clock_snapshots(sc));
+       }
 
        /* Write default clock class */
        if (bt_stream_class_borrow_default_clock_class_const(sc)) {
This page took 0.024011 seconds and 4 git commands to generate.