package tracev2

Import Path
	internal/trace/tracev2 (on go.dev)

Dependency Relation
	imports 0 packages, and imported by 6 packages

Involved Source Files Package tracev2 contains definitions for the v2 execution trace wire format. These definitions are shared between the trace parser and the runtime, so it must not depend on any package that depends on the runtime (most packages). events.go spec.go
Package-Level Type Names (total 5)
/* sort by: | */
EventSpec is a specification for a trace event. It contains sufficient information to perform basic parsing of any trace event for any version of Go. Args contains the names of each trace event's argument. Its length determines the number of arguments an event has. Argument names follow a certain structure and this structure is relied on by the testing framework to type-check arguments and to produce Values for experimental events. The structure is: (?P<name>[A-Za-z]+)(_(?P<type>[A-Za-z]+))? In sum, it's a name followed by an optional type. If the type is present, it is preceded with an underscore. Arguments without types will be interpreted as just raw uint64s. The valid argument types and the Go types they map to are listed in the ArgTypes variable. Experiment indicates the ID of an experiment this event is associated with. If Experiment is not NoExperiment, then the event is experimental and will be exposed as an EventExperiment. HasData is true if the event has trailer consisting of a varint length followed by unencoded bytes of some data. An event may not be both a timed event and have data. IsStack indicates that the event represents a complete stack trace. Specifically, it means that after the arguments there's a varint length, followed by 4*length varints. Each group of 4 represents the PC, file ID, func ID, and line number in that order. IsTimedEvent indicates whether this is an event that both appears in the main event stream and is surfaced to the trace reader. Events that are not "timed" are considered "structural" since they either need significant reinterpretation or otherwise aren't actually surfaced by the trace reader. Name is the human-readable name of the trace event. StackIDs indicates which of the arguments are stack IDs. The list is not sorted. The first index always refers to the main stack for the current execution context of the event. StartEv indicates the event type of the corresponding "start" event, if this event is an "end," for a pair of events that represent a time range. StringIDs indicates which of the arguments are string IDs. func Specs() []EventSpec func internal/trace/version.Version.Specs() []EventSpec func EventNames(specs []EventSpec) map[string]EventType
EventType indicates an event's type from which its arguments and semantics can be derived. Its representation matches the wire format's representation of the event types that precede all event data. ( EventType) Experimental() bool func EventNames(specs []EventSpec) map[string]EventType func internal/trace/internal/testgen.(*Batch).RawEvent(typ EventType, data []byte, args ...uint64) func internal/trace/internal/testgen.(*Trace).RawEvent(typ EventType, data []byte, args ...uint64) func internal/trace/version.Version.EventName(typ EventType) string const EvClockSnapshot const EvCPUSample const EvCPUSamples const EvEndOfGeneration const EvEventBatch const EvExperimentalBatch const EvFrequency const EvGCActive const EvGCBegin const EvGCEnd const EvGCMarkAssistActive const EvGCMarkAssistBegin const EvGCMarkAssistEnd const EvGCSweepActive const EvGCSweepBegin const EvGCSweepEnd const EvGoBlock const EvGoCreate const EvGoCreateBlocked const EvGoCreateSyscall const EvGoDestroy const EvGoDestroySyscall const EvGoLabel const EvGoroutineStack const EvGoroutineStackAlloc const EvGoroutineStackFree const EvGoStart const EvGoStatus const EvGoStatusStack const EvGoStop const EvGoSwitch const EvGoSwitchDestroy const EvGoSyscallBegin const EvGoSyscallEnd const EvGoSyscallEndBlocked const EvGoUnblock const EvHeapAlloc const EvHeapGoal const EvHeapObject const EvHeapObjectAlloc const EvHeapObjectFree const EvNone const EvProcsChange const EvProcStart const EvProcStatus const EvProcSteal const EvProcStop const EvSpan const EvSpanAlloc const EvSpanFree const EvStack const EvStacks const EvString const EvStrings const EvSTWBegin const EvSTWEnd const EvSync const EvUserLog const EvUserRegionBegin const EvUserRegionEnd const EvUserTaskBegin const EvUserTaskEnd const MaxEvent const MaxExperimentalEvent const NumEvents const NumExperimentalEvents
Experiment is an experiment ID that events may be associated with. const AllocFree const NoExperiment const NumExperiments
GoStatus is the status of a goroutine. They correspond directly to the various goroutine states. ( GoStatus) String() string GoStatus : expvar.Var GoStatus : fmt.Stringer const GoBad const GoRunnable const GoRunning const GoSyscall const GoWaiting
ProcStatus is the status of a P. They mostly correspond to the various P states. ( ProcStatus) String() string ProcStatus : expvar.Var ProcStatus : fmt.Stringer const ProcBad const ProcIdle const ProcRunning const ProcSyscall const ProcSyscallAbandoned
Package-Level Functions (total 3)
EventNames is a helper that produces a mapping of event names to event types.
func Specs() []EventSpec
Package-Level Variables (only one)
EventArgTypes is a list of valid argument types for use in Args. See the documentation of Args for more details.
Package-Level Constants (total 83)
AllocFree is the alloc-free events experiment.
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Reserved internal in-band end-of-generation signal. Must never appear in the trace. Added in Go 1.25. This could be used as an explicit in-band end-of-generation signal in the future.
Structural events.
Batch event for an experimental batch with a custom format. Added in Go 1.23.
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
GC events.
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Goroutines.
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Annotations.
Experimental goroutine stack events. Added in Go 1.23.
Experimental events.
Experimental events.
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
GoStatus with stack. Added in Go 1.23.
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Coroutines. Added in Go 1.23.
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Experimental heap object events. Added in Go 1.23.
Experimental events.
Experimental events.
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Procs.
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Experimental heap span events. Added in Go 1.23.
Experimental events.
Experimental events.
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
STW.
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Sync batch. Added in Go 1.25. Previously a lone EvFrequency event.
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
const GoBad GoStatus = 0
const GoRunnable GoStatus = 1
const GoRunning GoStatus = 2
const GoSyscall GoStatus = 3
const GoWaiting GoStatus = 4
MaxBatchSize sets the maximum size that a batch can be. Directly controls the trace batch size in the runtime. NOTE: If this number decreases, the trace format version must change.
Experimental events.
MaxEventTrailerDataSize controls the amount of trailer data that an event can have in bytes. Must be smaller than MaxBatchSize. Controls the maximum string size in the trace. Directly controls the maximum such value in the runtime. NOTE: If this number decreases, the trace format version must change.
Experimental events.
Maximum number of PCs in a single stack trace. Since events contain only stack ID rather than whole stack trace, we can allow quite large values here. Directly controls the maximum number of frames per stack in the runtime. NOTE: If this number decreases, the trace format version must change.
MaxTimedEventArgs is the maximum number of arguments for timed events.
NoExperiment is the reserved ID 0 indicating no experiment.
Event types in the trace, args are given in square brackets. Naming scheme: - Time range event pairs have suffixes "Begin" and "End". - "Start", "Stop", "Create", "Destroy", "Block", "Unblock" are suffixes reserved for scheduling resources. NOTE: If you add an event type, make sure you also update all tables in this file!
Experiments.
const ProcBad ProcStatus = 0
const ProcIdle ProcStatus = 2
ProcSyscallAbandoned is a special case of ProcSyscall. It's used in the very specific case where the first a P is mentioned in a generation is part of a ProcSteal event. If that's the first time it's mentioned, then there's no GoSyscallBegin to connect the P stealing back to at that point. This special state indicates this to the parser, so it doesn't try to find a GoSyscallEndBlocked that corresponds with the ProcSteal.