type EventKind … const EventBad … const EventSync … const EventMetric … const EventLabel … const EventStackSample … const EventRangeBegin … const EventRangeActive … const EventRangeEnd … const EventTaskBegin … const EventTaskEnd … const EventRegionBegin … const EventRegionEnd … const EventLog … const EventStateTransition … const EventExperimental … // String returns a string form of the EventKind. func (e EventKind) String() string { … } var eventKindStrings … const maxTime … type Time … // Sub subtracts t0 from t, returning the duration in nanoseconds. func (t Time) Sub(t0 Time) time.Duration { … } type Metric … type Label … type Range … type RangeAttribute … type TaskID … const NoTask … const BackgroundTask … type Task … type Region … type Log … type Stack … // Frames is an iterator over the frames in a Stack. func (s Stack) Frames() iter.Seq[StackFrame] { … } var NoStack … type StackFrame … type ExperimentalEvent … type ExperimentalData … type ExperimentalBatch … type Event … // Kind returns the kind of event that this is. func (e Event) Kind() EventKind { … } // Time returns the timestamp of the event. func (e Event) Time() Time { … } // Goroutine returns the ID of the goroutine that was executing when // this event happened. It describes part of the execution context // for this event. // // Note that for goroutine state transitions this always refers to the // state before the transition. For example, if a goroutine is just // starting to run on this thread and/or proc, then this will return // NoGoroutine. In this case, the goroutine starting to run will be // can be found at Event.StateTransition().Resource. func (e Event) Goroutine() GoID { … } // Proc returns the ID of the proc this event event pertains to. // // Note that for proc state transitions this always refers to the // state before the transition. For example, if a proc is just // starting to run on this thread, then this will return NoProc. func (e Event) Proc() ProcID { … } // Thread returns the ID of the thread this event pertains to. // // Note that for thread state transitions this always refers to the // state before the transition. For example, if a thread is just // starting to run, then this will return NoThread. // // Note: tracking thread state is not currently supported, so this // will always return a valid thread ID. However thread state transitions // may be tracked in the future, and callers must be robust to this // possibility. func (e Event) Thread() ThreadID { … } // Stack returns a handle to a stack associated with the event. // // This represents a stack trace at the current moment in time for // the current execution context. func (e Event) Stack() Stack { … } // Metric returns details about a Metric event. // // Panics if Kind != EventMetric. func (e Event) Metric() Metric { … } // Label returns details about a Label event. // // Panics if Kind != EventLabel. func (e Event) Label() Label { … } // Range returns details about an EventRangeBegin, EventRangeActive, or EventRangeEnd event. // // Panics if Kind != EventRangeBegin, Kind != EventRangeActive, and Kind != EventRangeEnd. func (e Event) Range() Range { … } // RangeAttributes returns attributes for a completed range. // // Panics if Kind != EventRangeEnd. func (e Event) RangeAttributes() []RangeAttribute { … } // Task returns details about a TaskBegin or TaskEnd event. // // Panics if Kind != EventTaskBegin and Kind != EventTaskEnd. func (e Event) Task() Task { … } // Region returns details about a RegionBegin or RegionEnd event. // // Panics if Kind != EventRegionBegin and Kind != EventRegionEnd. func (e Event) Region() Region { … } // Log returns details about a Log event. // // Panics if Kind != EventLog. func (e Event) Log() Log { … } // StateTransition returns details about a StateTransition event. // // Panics if Kind != EventStateTransition. func (e Event) StateTransition() StateTransition { … } // Experimental returns a view of the raw event for an experimental event. // // Panics if Kind != EventExperimental. func (e Event) Experimental() ExperimentalEvent { … } const evSync … var go122Type2Kind … var go122GoStatus2GoState … var go122ProcStatus2ProcState … // String returns the event as a human-readable string. // // The format of the string is intended for debugging and is subject to change. func (e Event) String() string { … } // validateTableIDs checks to make sure lookups in e.table // will work. func (e Event) validateTableIDs() error { … } func syncEvent(table *evTable, ts Time) Event { … }