tp: split clock tracker API into composable primitives#4807
Open
LalitMaganti wants to merge 14 commits intomainfrom
Open
tp: split clock tracker API into composable primitives#4807LalitMaganti wants to merge 14 commits intomainfrom
LalitMaganti wants to merge 14 commits intomainfrom
Conversation
This CL implements what was described at #4573 by making the ClockTracker per-trace + machine to avoid two traces with clock snapshots from clashing with each other. Instead everyone only uses the primary trace's clock snapshots if they don't have their own.
c59a926 to
4dba8e1
Compare
ecc6f1a to
67cb2bf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split
ClockTracker::SetTraceTimeClockinto three composable primitives:SetGlobalClock: sets the shared trace time clock. Errors ifconversions already happened. Tracks ownership so only one trace
file can set it.
SetTraceDefaultClock: sets the per-trace-file default clock, usedas fallback when no
timestamp_clock_idis specified. Onlymeaningful for proto traces.
AddDeferredIdentitySync: registers a clock for lazy identity-edgeinjection. On the first
ToTraceTimecall, if the registered clockisn't already in the clock graph, a 0:0 edge is added between it
and the global trace time clock.
Also centralizes clock setup in
ForwardingTraceParser::Init()so eachtrace format sets its global clock there rather than in individual
tokenizers.
Proto traces defer clock setup:
ForwardingTraceParserregisters adeferred identity sync for BOOTTIME, and
ParseClockSnapshotlatercalls
SetGlobalClock+SetTraceDefaultClockwhen a clock snapshotarrives.
Other cleanups: removes
OnFirstTraceTimeUse/used_for_conversion(replaced by
num_conversions_), removes redundantprimary_sync_member, and fixes
power_rails_multi_devicediff test to include aproper clock_snapshot.