package go122
import (
"fmt"
"internal/trace/event"
)
const (
EvNone event .Type = 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
)
const (
AllocFree event .Experiment = 1 + iota
)
const (
_ event .Type = 127 + iota
EvSpan
EvSpanAlloc
EvSpanFree
EvHeapObject
EvHeapObjectAlloc
EvHeapObjectFree
EvGoroutineStack
EvGoroutineStackAlloc
EvGoroutineStackFree
)
func EventString (typ event .Type ) string {
if int (typ ) < len (specs ) {
return specs [typ ].Name
}
return fmt .Sprintf ("Invalid(%d)" , typ )
}
func Specs () []event .Spec {
return specs [:]
}
var specs = [...]event .Spec {
EvEventBatch : event .Spec {
Name : "EventBatch" ,
Args : []string {"gen" , "m" , "time" , "size" },
},
EvStacks : event .Spec {
Name : "Stacks" ,
},
EvStack : event .Spec {
Name : "Stack" ,
Args : []string {"id" , "nframes" },
IsStack : true ,
},
EvStrings : event .Spec {
Name : "Strings" ,
},
EvString : event .Spec {
Name : "String" ,
Args : []string {"id" },
HasData : true ,
},
EvCPUSamples : event .Spec {
Name : "CPUSamples" ,
},
EvCPUSample : event .Spec {
Name : "CPUSample" ,
Args : []string {"time" , "m" , "p" , "g" , "stack" },
},
EvFrequency : event .Spec {
Name : "Frequency" ,
Args : []string {"freq" },
},
EvExperimentalBatch : event .Spec {
Name : "ExperimentalBatch" ,
Args : []string {"exp" , "gen" , "m" , "time" },
HasData : true ,
},
EvProcsChange : event .Spec {
Name : "ProcsChange" ,
Args : []string {"dt" , "procs_value" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {2 },
},
EvProcStart : event .Spec {
Name : "ProcStart" ,
Args : []string {"dt" , "p" , "p_seq" },
IsTimedEvent : true ,
},
EvProcStop : event .Spec {
Name : "ProcStop" ,
Args : []string {"dt" },
IsTimedEvent : true ,
},
EvProcSteal : event .Spec {
Name : "ProcSteal" ,
Args : []string {"dt" , "p" , "p_seq" , "m" },
IsTimedEvent : true ,
},
EvProcStatus : event .Spec {
Name : "ProcStatus" ,
Args : []string {"dt" , "p" , "pstatus" },
IsTimedEvent : true ,
},
EvGoCreate : event .Spec {
Name : "GoCreate" ,
Args : []string {"dt" , "new_g" , "new_stack" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {3 , 2 },
},
EvGoCreateSyscall : event .Spec {
Name : "GoCreateSyscall" ,
Args : []string {"dt" , "new_g" },
IsTimedEvent : true ,
},
EvGoStart : event .Spec {
Name : "GoStart" ,
Args : []string {"dt" , "g" , "g_seq" },
IsTimedEvent : true ,
},
EvGoDestroy : event .Spec {
Name : "GoDestroy" ,
Args : []string {"dt" },
IsTimedEvent : true ,
},
EvGoDestroySyscall : event .Spec {
Name : "GoDestroySyscall" ,
Args : []string {"dt" },
IsTimedEvent : true ,
},
EvGoStop : event .Spec {
Name : "GoStop" ,
Args : []string {"dt" , "reason_string" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {2 },
StringIDs : []int {1 },
},
EvGoBlock : event .Spec {
Name : "GoBlock" ,
Args : []string {"dt" , "reason_string" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {2 },
StringIDs : []int {1 },
},
EvGoUnblock : event .Spec {
Name : "GoUnblock" ,
Args : []string {"dt" , "g" , "g_seq" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {3 },
},
EvGoSyscallBegin : event .Spec {
Name : "GoSyscallBegin" ,
Args : []string {"dt" , "p_seq" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {2 },
},
EvGoSyscallEnd : event .Spec {
Name : "GoSyscallEnd" ,
Args : []string {"dt" },
StartEv : EvGoSyscallBegin ,
IsTimedEvent : true ,
},
EvGoSyscallEndBlocked : event .Spec {
Name : "GoSyscallEndBlocked" ,
Args : []string {"dt" },
StartEv : EvGoSyscallBegin ,
IsTimedEvent : true ,
},
EvGoStatus : event .Spec {
Name : "GoStatus" ,
Args : []string {"dt" , "g" , "m" , "gstatus" },
IsTimedEvent : true ,
},
EvSTWBegin : event .Spec {
Name : "STWBegin" ,
Args : []string {"dt" , "kind_string" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {2 },
StringIDs : []int {1 },
},
EvSTWEnd : event .Spec {
Name : "STWEnd" ,
Args : []string {"dt" },
StartEv : EvSTWBegin ,
IsTimedEvent : true ,
},
EvGCActive : event .Spec {
Name : "GCActive" ,
Args : []string {"dt" , "gc_seq" },
IsTimedEvent : true ,
StartEv : EvGCBegin ,
},
EvGCBegin : event .Spec {
Name : "GCBegin" ,
Args : []string {"dt" , "gc_seq" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {2 },
},
EvGCEnd : event .Spec {
Name : "GCEnd" ,
Args : []string {"dt" , "gc_seq" },
StartEv : EvGCBegin ,
IsTimedEvent : true ,
},
EvGCSweepActive : event .Spec {
Name : "GCSweepActive" ,
Args : []string {"dt" , "p" },
StartEv : EvGCSweepBegin ,
IsTimedEvent : true ,
},
EvGCSweepBegin : event .Spec {
Name : "GCSweepBegin" ,
Args : []string {"dt" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {1 },
},
EvGCSweepEnd : event .Spec {
Name : "GCSweepEnd" ,
Args : []string {"dt" , "swept_value" , "reclaimed_value" },
StartEv : EvGCSweepBegin ,
IsTimedEvent : true ,
},
EvGCMarkAssistActive : event .Spec {
Name : "GCMarkAssistActive" ,
Args : []string {"dt" , "g" },
StartEv : EvGCMarkAssistBegin ,
IsTimedEvent : true ,
},
EvGCMarkAssistBegin : event .Spec {
Name : "GCMarkAssistBegin" ,
Args : []string {"dt" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {1 },
},
EvGCMarkAssistEnd : event .Spec {
Name : "GCMarkAssistEnd" ,
Args : []string {"dt" },
StartEv : EvGCMarkAssistBegin ,
IsTimedEvent : true ,
},
EvHeapAlloc : event .Spec {
Name : "HeapAlloc" ,
Args : []string {"dt" , "heapalloc_value" },
IsTimedEvent : true ,
},
EvHeapGoal : event .Spec {
Name : "HeapGoal" ,
Args : []string {"dt" , "heapgoal_value" },
IsTimedEvent : true ,
},
EvGoLabel : event .Spec {
Name : "GoLabel" ,
Args : []string {"dt" , "label_string" },
IsTimedEvent : true ,
StringIDs : []int {1 },
},
EvUserTaskBegin : event .Spec {
Name : "UserTaskBegin" ,
Args : []string {"dt" , "task" , "parent_task" , "name_string" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {4 },
StringIDs : []int {3 },
},
EvUserTaskEnd : event .Spec {
Name : "UserTaskEnd" ,
Args : []string {"dt" , "task" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {2 },
},
EvUserRegionBegin : event .Spec {
Name : "UserRegionBegin" ,
Args : []string {"dt" , "task" , "name_string" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {3 },
StringIDs : []int {2 },
},
EvUserRegionEnd : event .Spec {
Name : "UserRegionEnd" ,
Args : []string {"dt" , "task" , "name_string" , "stack" },
StartEv : EvUserRegionBegin ,
IsTimedEvent : true ,
StackIDs : []int {3 },
StringIDs : []int {2 },
},
EvUserLog : event .Spec {
Name : "UserLog" ,
Args : []string {"dt" , "task" , "key_string" , "value_string" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {4 },
StringIDs : []int {2 , 3 },
},
EvGoSwitch : event .Spec {
Name : "GoSwitch" ,
Args : []string {"dt" , "g" , "g_seq" },
IsTimedEvent : true ,
},
EvGoSwitchDestroy : event .Spec {
Name : "GoSwitchDestroy" ,
Args : []string {"dt" , "g" , "g_seq" },
IsTimedEvent : true ,
},
EvGoCreateBlocked : event .Spec {
Name : "GoCreateBlocked" ,
Args : []string {"dt" , "new_g" , "new_stack" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {3 , 2 },
},
EvGoStatusStack : event .Spec {
Name : "GoStatusStack" ,
Args : []string {"dt" , "g" , "m" , "gstatus" , "stack" },
IsTimedEvent : true ,
StackIDs : []int {4 },
},
EvSpan : event .Spec {
Name : "Span" ,
Args : []string {"dt" , "id" , "npages_value" , "kindclass" },
IsTimedEvent : true ,
Experiment : AllocFree ,
},
EvSpanAlloc : event .Spec {
Name : "SpanAlloc" ,
Args : []string {"dt" , "id" , "npages_value" , "kindclass" },
IsTimedEvent : true ,
Experiment : AllocFree ,
},
EvSpanFree : event .Spec {
Name : "SpanFree" ,
Args : []string {"dt" , "id" },
IsTimedEvent : true ,
Experiment : AllocFree ,
},
EvHeapObject : event .Spec {
Name : "HeapObject" ,
Args : []string {"dt" , "id" , "type" },
IsTimedEvent : true ,
Experiment : AllocFree ,
},
EvHeapObjectAlloc : event .Spec {
Name : "HeapObjectAlloc" ,
Args : []string {"dt" , "id" , "type" },
IsTimedEvent : true ,
Experiment : AllocFree ,
},
EvHeapObjectFree : event .Spec {
Name : "HeapObjectFree" ,
Args : []string {"dt" , "id" },
IsTimedEvent : true ,
Experiment : AllocFree ,
},
EvGoroutineStack : event .Spec {
Name : "GoroutineStack" ,
Args : []string {"dt" , "id" , "order" },
IsTimedEvent : true ,
Experiment : AllocFree ,
},
EvGoroutineStackAlloc : event .Spec {
Name : "GoroutineStackAlloc" ,
Args : []string {"dt" , "id" , "order" },
IsTimedEvent : true ,
Experiment : AllocFree ,
},
EvGoroutineStackFree : event .Spec {
Name : "GoroutineStackFree" ,
Args : []string {"dt" , "id" },
IsTimedEvent : true ,
Experiment : AllocFree ,
},
}
type GoStatus uint8
const (
GoBad GoStatus = iota
GoRunnable
GoRunning
GoSyscall
GoWaiting
)
func (s GoStatus ) String () string {
switch s {
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 (s ProcStatus ) String () string {
switch s {
case ProcRunning :
return "Running"
case ProcIdle :
return "Idle"
case ProcSyscall :
return "Syscall"
}
return "Bad"
}
const (
MaxBatchSize = 64 << 10
MaxFramesPerStack = 128
MaxStringSize = 1 << 10
)
The pages are generated with Golds v0.7.0-preview . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .