- /* Update default clock from packet's end time */
- if (notit->snapshots.end_clock != UINT64_C(-1)) {
+ /* Check if may be affected by lttng-crash timestamp_end quirk. */
+ if (G_UNLIKELY(notit->meta.tc->quirks.lttng_crash)) {
+ /*
+ * Check if the `timestamp_begin` field is non-zero but
+ * `timestamp_end` is zero. It means the trace is affected by
+ * the lttng-crash packet `timestamp_end` quirk and must be
+ * fixed up by omitting to update the default clock snapshot to
+ * the `timestamp_end` as is typically done.
+ */
+ if (notit->snapshots.beginning_clock != 0 &&
+ notit->snapshots.end_clock == 0) {
+ update_default_cs = false;
+ }
+ }
+
+ /* Update default clock from packet's end time. */
+ if (notit->snapshots.end_clock != UINT64_C(-1) && update_default_cs) {