- append_indent(ctx);
- append_integer_field_class_from_props(ctx, 64, 8, false,
- BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL,
- NULL, "events_discarded", true);
+ if (sc->has_discarded_events) {
+ append_indent(ctx);
+ append_integer_field_class_from_props(ctx, 64, 8, false,
+ BT_FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL,
+ NULL, "events_discarded", true);
+ }
+
+ /*
+ * Unconditionnally write the packet sequence number as, even if
+ * there's no possible discarded packets message, it's still
+ * useful information to have.
+ */