package tracev2
const (
EvNone EventType = iota
EvEventBatch
EvStacks
EvStack
EvStrings
EvString
EvCPUSamples
EvCPUSample
EvFrequency
EvProcsChange
EvProcStart
EvProcStop
EvProcSteal
EvProcStatus
EvGoCreate
EvGoCreateSyscall
EvGoStart
EvGoDestroy
EvGoDestroySyscall
EvGoStop
EvGoBlock
EvGoUnblock
EvGoSyscallBegin
EvGoSyscallEnd
EvGoSyscallEndBlocked
EvGoStatus
EvSTWBegin
EvSTWEnd
EvGCActive
EvGCBegin
EvGCEnd
EvGCSweepActive
EvGCSweepBegin
EvGCSweepEnd
EvGCMarkAssistActive
EvGCMarkAssistBegin
EvGCMarkAssistEnd
EvHeapAlloc
EvHeapGoal
EvGoLabel
EvUserTaskBegin
EvUserTaskEnd
EvUserRegionBegin
EvUserRegionEnd
EvUserLog
EvGoSwitch
EvGoSwitchDestroy
EvGoCreateBlocked
EvGoStatusStack
EvExperimentalBatch
EvSync
EvClockSnapshot
EvEndOfGeneration
NumEvents
)
func ( EventType) () bool {
return > MaxEvent && < MaxExperimentalEvent
}
const (
AllocFree Experiment = 1 + iota
NumExperiments
)
func () []string {
return experiments[:]
}
var experiments = [...]string{
NoExperiment: "None",
AllocFree: "AllocFree",
}
const (
MaxEvent EventType = 127 + iota
EvSpan
EvSpanAlloc
EvSpanFree
EvHeapObject
EvHeapObjectAlloc
EvHeapObjectFree
EvGoroutineStack
EvGoroutineStackAlloc
EvGoroutineStackFree
MaxExperimentalEvent
)
const NumExperimentalEvents = MaxExperimentalEvent - MaxEvent
const MaxTimedEventArgs = 5
func () []EventSpec {
return specs[:]
}
var specs = [...]EventSpec{
EvEventBatch: {
Name: "EventBatch",
Args: []string{"gen", "m", "time", "size"},
},
EvStacks: {
Name: "Stacks",
},
EvStack: {
Name: "Stack",
Args: []string{"id", "nframes"},
IsStack: true,
},
EvStrings: {
Name: "Strings",
},
EvString: {
Name: "String",
Args: []string{"id"},
HasData: true,
},
EvCPUSamples: {
Name: "CPUSamples",
},
EvCPUSample: {
Name: "CPUSample",
Args: []string{"time", "m", "p", "g", "stack"},
StackIDs: []int{4},
},
EvFrequency: {
Name: "Frequency",
Args: []string{"freq"},
},
EvExperimentalBatch: {
Name: "ExperimentalBatch",
Args: []string{"exp", "gen", "m", "time"},
HasData: true,
},
EvSync: {
Name: "Sync",
},
EvEndOfGeneration: {
Name: "EndOfGeneration",
},
EvProcsChange: {
Name: "ProcsChange",
Args: []string{"dt", "procs_value", "stack"},
IsTimedEvent: true,
StackIDs: []int{2},
},
EvProcStart: {
Name: "ProcStart",
Args: []string{"dt", "p", "p_seq"},
IsTimedEvent: true,
},
EvProcStop: {
Name: "ProcStop",
Args: []string{"dt"},
IsTimedEvent: true,
},
EvProcSteal: {
Name: "ProcSteal",
Args: []string{"dt", "p", "p_seq", "m"},
IsTimedEvent: true,
},
EvProcStatus: {
Name: "ProcStatus",
Args: []string{"dt", "p", "pstatus"},
IsTimedEvent: true,
},
EvGoCreate: {
Name: "GoCreate",
Args: []string{"dt", "new_g", "new_stack", "stack"},
IsTimedEvent: true,
StackIDs: []int{3, 2},
},
EvGoCreateSyscall: {
Name: "GoCreateSyscall",
Args: []string{"dt", "new_g"},
IsTimedEvent: true,
},
EvGoStart: {
Name: "GoStart",
Args: []string{"dt", "g", "g_seq"},
IsTimedEvent: true,
},
EvGoDestroy: {
Name: "GoDestroy",
Args: []string{"dt"},
IsTimedEvent: true,
},
EvGoDestroySyscall: {
Name: "GoDestroySyscall",
Args: []string{"dt"},
IsTimedEvent: true,
},
EvGoStop: {
Name: "GoStop",
Args: []string{"dt", "reason_string", "stack"},
IsTimedEvent: true,
StackIDs: []int{2},
StringIDs: []int{1},
},
EvGoBlock: {
Name: "GoBlock",
Args: []string{"dt", "reason_string", "stack"},
IsTimedEvent: true,
StackIDs: []int{2},
StringIDs: []int{1},
},
EvGoUnblock: {
Name: "GoUnblock",
Args: []string{"dt", "g", "g_seq", "stack"},
IsTimedEvent: true,
StackIDs: []int{3},
},
EvGoSyscallBegin: {
Name: "GoSyscallBegin",
Args: []string{"dt", "p_seq", "stack"},
IsTimedEvent: true,
StackIDs: []int{2},
},
EvGoSyscallEnd: {
Name: "GoSyscallEnd",
Args: []string{"dt"},
StartEv: EvGoSyscallBegin,
IsTimedEvent: true,
},
EvGoSyscallEndBlocked: {
Name: "GoSyscallEndBlocked",
Args: []string{"dt"},
StartEv: EvGoSyscallBegin,
IsTimedEvent: true,
},
EvGoStatus: {
Name: "GoStatus",
Args: []string{"dt", "g", "m", "gstatus"},
IsTimedEvent: true,
},
EvSTWBegin: {
Name: "STWBegin",
Args: []string{"dt", "kind_string", "stack"},
IsTimedEvent: true,
StackIDs: []int{2},
StringIDs: []int{1},
},
EvSTWEnd: {
Name: "STWEnd",
Args: []string{"dt"},
StartEv: EvSTWBegin,
IsTimedEvent: true,
},
EvGCActive: {
Name: "GCActive",
Args: []string{"dt", "gc_seq"},
IsTimedEvent: true,
StartEv: EvGCBegin,
},
EvGCBegin: {
Name: "GCBegin",
Args: []string{"dt", "gc_seq", "stack"},
IsTimedEvent: true,
StackIDs: []int{2},
},
EvGCEnd: {
Name: "GCEnd",
Args: []string{"dt", "gc_seq"},
StartEv: EvGCBegin,
IsTimedEvent: true,
},
EvGCSweepActive: {
Name: "GCSweepActive",
Args: []string{"dt", "p"},
StartEv: EvGCSweepBegin,
IsTimedEvent: true,
},
EvGCSweepBegin: {
Name: "GCSweepBegin",
Args: []string{"dt", "stack"},
IsTimedEvent: true,
StackIDs: []int{1},
},
EvGCSweepEnd: {
Name: "GCSweepEnd",
Args: []string{"dt", "swept_value", "reclaimed_value"},
StartEv: EvGCSweepBegin,
IsTimedEvent: true,
},
EvGCMarkAssistActive: {
Name: "GCMarkAssistActive",
Args: []string{"dt", "g"},
StartEv: EvGCMarkAssistBegin,
IsTimedEvent: true,
},
EvGCMarkAssistBegin: {
Name: "GCMarkAssistBegin",
Args: []string{"dt", "stack"},
IsTimedEvent: true,
StackIDs: []int{1},
},
EvGCMarkAssistEnd: {
Name: "GCMarkAssistEnd",
Args: []string{"dt"},
StartEv: EvGCMarkAssistBegin,
IsTimedEvent: true,
},
EvHeapAlloc: {
Name: "HeapAlloc",
Args: []string{"dt", "heapalloc_value"},
IsTimedEvent: true,
},
EvHeapGoal: {
Name: "HeapGoal",
Args: []string{"dt", "heapgoal_value"},
IsTimedEvent: true,
},
EvGoLabel: {
Name: "GoLabel",
Args: []string{"dt", "label_string"},
IsTimedEvent: true,
StringIDs: []int{1},
},
EvUserTaskBegin: {
Name: "UserTaskBegin",
Args: []string{"dt", "task", "parent_task", "name_string", "stack"},
IsTimedEvent: true,
StackIDs: []int{4},
StringIDs: []int{3},
},
EvUserTaskEnd: {
Name: "UserTaskEnd",
Args: []string{"dt", "task", "stack"},
IsTimedEvent: true,
StackIDs: []int{2},
},
EvUserRegionBegin: {
Name: "UserRegionBegin",
Args: []string{"dt", "task", "name_string", "stack"},
IsTimedEvent: true,
StackIDs: []int{3},
StringIDs: []int{2},
},
EvUserRegionEnd: {
Name: "UserRegionEnd",
Args: []string{"dt", "task", "name_string", "stack"},
StartEv: EvUserRegionBegin,
IsTimedEvent: true,
StackIDs: []int{3},
StringIDs: []int{2},
},
EvUserLog: {
Name: "UserLog",
Args: []string{"dt", "task", "key_string", "value_string", "stack"},
IsTimedEvent: true,
StackIDs: []int{4},
StringIDs: []int{2, 3},
},
EvGoSwitch: {
Name: "GoSwitch",
Args: []string{"dt", "g", "g_seq"},
IsTimedEvent: true,
},
EvGoSwitchDestroy: {
Name: "GoSwitchDestroy",
Args: []string{"dt", "g", "g_seq"},
IsTimedEvent: true,
},
EvGoCreateBlocked: {
Name: "GoCreateBlocked",
Args: []string{"dt", "new_g", "new_stack", "stack"},
IsTimedEvent: true,
StackIDs: []int{3, 2},
},
EvGoStatusStack: {
Name: "GoStatusStack",
Args: []string{"dt", "g", "m", "gstatus", "stack"},
IsTimedEvent: true,
StackIDs: []int{4},
},
EvClockSnapshot: {
Name: "ClockSnapshot",
Args: []string{"dt", "mono", "sec", "nsec"},
IsTimedEvent: true,
},
EvSpan: {
Name: "Span",
Args: []string{"dt", "id", "npages_value", "kindclass"},
IsTimedEvent: true,
Experiment: AllocFree,
},
EvSpanAlloc: {
Name: "SpanAlloc",
Args: []string{"dt", "id", "npages_value", "kindclass"},
IsTimedEvent: true,
Experiment: AllocFree,
},
EvSpanFree: {
Name: "SpanFree",
Args: []string{"dt", "id"},
IsTimedEvent: true,
Experiment: AllocFree,
},
EvHeapObject: {
Name: "HeapObject",
Args: []string{"dt", "id", "type"},
IsTimedEvent: true,
Experiment: AllocFree,
},
EvHeapObjectAlloc: {
Name: "HeapObjectAlloc",
Args: []string{"dt", "id", "type"},
IsTimedEvent: true,
Experiment: AllocFree,
},
EvHeapObjectFree: {
Name: "HeapObjectFree",
Args: []string{"dt", "id"},
IsTimedEvent: true,
Experiment: AllocFree,
},
EvGoroutineStack: {
Name: "GoroutineStack",
Args: []string{"dt", "id", "order"},
IsTimedEvent: true,
Experiment: AllocFree,
},
EvGoroutineStackAlloc: {
Name: "GoroutineStackAlloc",
Args: []string{"dt", "id", "order"},
IsTimedEvent: true,
Experiment: AllocFree,
},
EvGoroutineStackFree: {
Name: "GoroutineStackFree",
Args: []string{"dt", "id"},
IsTimedEvent: true,
Experiment: AllocFree,
},
}
type GoStatus uint8
const (
GoBad GoStatus = iota
GoRunnable
GoRunning
GoSyscall
GoWaiting
)
func ( GoStatus) () string {
switch {
case GoRunnable:
return "Runnable"
case GoRunning:
return "Running"
case GoSyscall:
return "Syscall"
case GoWaiting:
return "Waiting"
}
return "Bad"
}
type ProcStatus uint8
const (
ProcBad ProcStatus = iota
ProcRunning
ProcIdle
ProcSyscall
ProcSyscallAbandoned
)
func ( ProcStatus) () string {
switch {
case ProcRunning:
return "Running"
case ProcIdle:
return "Idle"
case ProcSyscall:
return "Syscall"
}
return "Bad"
}
const (
MaxBatchSize = 64 << 10
MaxFramesPerStack = 128
MaxEventTrailerDataSize = 1 << 10
)