Skip to content

tp: suppress spurious clock sync errors for deferred packets#5171

Open
LalitMaganti wants to merge 1 commit intomainfrom
dev/lalitm/clock-sync-suppress-spurious-errors
Open

tp: suppress spurious clock sync errors for deferred packets#5171
LalitMaganti wants to merge 1 commit intomainfrom
dev/lalitm/clock-sync-suppress-spurious-errors

Conversation

@LalitMaganti
Copy link
Member

@LalitMaganti LalitMaganti commented Mar 18, 2026

  • Plumb a suppress_errors bool through ClockSynchronizer::ConvertConvertSlowpath to skip recording clock sync errors when a packet will be deferred for later resolution
  • Extract convert-or-defer logic into ResolveTimestampToTraceTime with a clear three-state enum (kResolved, kDeferred, kDropped) for readability
  • Add clock_sync_failure_undeferrable_packet_loss stat (via import logging) for the rare case where conversion fails and deferral is not possible
  • Add unit test verifying no spurious clock_sync_failure_unknown_source_clock error when a sequence-scoped clock packet arrives before its ClockSnapshot

Fixes #5163

@LalitMaganti LalitMaganti requested a review from a team as a code owner March 18, 2026 12:35
When a packet arrives with a sequence-scoped clock before its
ClockSnapshot, ToTraceTime fails and records a spurious
clock_sync_failure_unknown_source_clock error even though the
packet will be resolved later at EOF.

Fix this by plumbing a suppress_errors bool through the conversion
path (ClockSynchronizer::Convert -> ConvertSlowpath). Before EOF,
errors are suppressed and the packet is deferred. At EOF, errors
are allowed so genuinely broken clocks are still reported.

Extract the convert-or-defer logic into an inline helper
ResolveTimestampToTraceTime with a clear three-state return
(kResolved, kDeferred, kDropped) to make the hot path readable.

Add clock_sync_failure_undeferrable_packet_loss stat (with import
logging) for the rare case where conversion fails and deferral
is not possible.

Bug: #5163
@LalitMaganti LalitMaganti force-pushed the dev/lalitm/clock-sync-suppress-spurious-errors branch from df64615 to e8d6a63 Compare March 18, 2026 12:36
@LalitMaganti LalitMaganti requested a review from aMayzner March 18, 2026 12:37
@github-actions
Copy link

🎨 Perfetto UI Builds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tp: spurious clock_sync errors for deferred sequence-scoped clock snapshot packets

1 participant