Documentation
¶
Index ¶
- Constants
- Variables
- func GoroutineStats(events []*Event) map[uint64]*GDesc
- func IsSystemGoroutine(entryFn string) bool
- func MutatorUtilization(events []*Event, flags UtilFlags) [][]MutatorUtil
- func Print(events []*Event)
- func PrintEvent(ev *Event)
- func RelatedGoroutines(events []*Event, goid uint64) map[uint64]bool
- type Event
- type Frame
- type GDesc
- type GExecutionStat
- type MMUCurve
- type MutatorUtil
- type ParseResult
- type UserRegionDesc
- type UtilFlags
- type UtilWindow
- type Writer
Constants ¶
View Source
const ( // Special P identifiers: FakeP = 1000000 + iota TimerP // depicts timer unblocks NetpollP // depicts network unblocks SyscallP // depicts returns from syscalls GCP // depicts GC state ProfileP // depicts recording of CPU profile samples )
View Source
const ( EvNone = 0 // unused EvBatch = 1 // start of per-P batch of events [pid, timestamp] EvFrequency = 2 // contains tracer timer frequency [frequency (ticks per second)] EvStack = 3 // stack [stack id, number of PCs, array of {PC, func string ID, file string ID, line}] EvGomaxprocs = 4 // current value of GOMAXPROCS [timestamp, GOMAXPROCS, stack id] EvProcStart = 5 // start of P [timestamp, thread id] EvProcStop = 6 // stop of P [timestamp] EvGCStart = 7 // GC start [timestamp, seq, stack id] EvGCDone = 8 // GC done [timestamp] EvGCSTWStart = 9 // GC mark termination start [timestamp, kind] EvGCSTWDone = 10 // GC mark termination done [timestamp] EvGCSweepStart = 11 // GC sweep start [timestamp, stack id] EvGCSweepDone = 12 // GC sweep done [timestamp, swept, reclaimed] EvGoCreate = 13 // goroutine creation [timestamp, new goroutine id, new stack id, stack id] EvGoStart = 14 // goroutine starts running [timestamp, goroutine id, seq] EvGoEnd = 15 // goroutine ends [timestamp] EvGoStop = 16 // goroutine stops (like in select{}) [timestamp, stack] EvGoSched = 17 // goroutine calls Gosched [timestamp, stack] EvGoPreempt = 18 // goroutine is preempted [timestamp, stack] EvGoSleep = 19 // goroutine calls Sleep [timestamp, stack] EvGoBlock = 20 // goroutine blocks [timestamp, stack] EvGoUnblock = 21 // goroutine is unblocked [timestamp, goroutine id, seq, stack] EvGoBlockSend = 22 // goroutine blocks on chan send [timestamp, stack] EvGoBlockRecv = 23 // goroutine blocks on chan recv [timestamp, stack] EvGoBlockSelect = 24 // goroutine blocks on select [timestamp, stack] EvGoBlockSync = 25 // goroutine blocks on Mutex/RWMutex [timestamp, stack] EvGoBlockCond = 26 // goroutine blocks on Cond [timestamp, stack] EvGoBlockNet = 27 // goroutine blocks on network [timestamp, stack] EvGoSysCall = 28 // syscall enter [timestamp, stack] EvGoSysExit = 29 // syscall exit [timestamp, goroutine id, seq, real timestamp] EvGoSysBlock = 30 // syscall blocks [timestamp] EvGoWaiting = 31 // denotes that goroutine is blocked when tracing starts [timestamp, goroutine id] EvGoInSyscall = 32 // denotes that goroutine is in syscall when tracing starts [timestamp, goroutine id] EvHeapAlloc = 33 // gcController.heapLive change [timestamp, heap live bytes] EvHeapGoal = 34 // gcController.heapGoal change [timestamp, heap goal bytes] EvTimerGoroutine = 35 // denotes timer goroutine [timer goroutine id] EvFutileWakeup = 36 // denotes that the previous wakeup of this goroutine was futile [timestamp] EvString = 37 // string dictionary entry [ID, length, string] EvGoStartLocal = 38 // goroutine starts running on the same P as the last event [timestamp, goroutine id] EvGoUnblockLocal = 39 // goroutine is unblocked on the same P as the last event [timestamp, goroutine id, stack] EvGoSysExitLocal = 40 // syscall exit on the same P as the last event [timestamp, goroutine id, real timestamp] EvGoStartLabel = 41 // goroutine starts running with label [timestamp, goroutine id, seq, label string id] EvGoBlockGC = 42 // goroutine blocks on GC assist [timestamp, stack] EvGCMarkAssistStart = 43 // GC mark assist start [timestamp, stack] EvGCMarkAssistDone = 44 // GC mark assist done [timestamp] EvUserTaskCreate = 45 // trace.NewContext [timestamp, internal task id, internal parent id, stack, name string] EvUserTaskEnd = 46 // end of task [timestamp, internal task id, stack] EvUserRegion = 47 // trace.WithRegion [timestamp, internal task id, mode(0:start, 1:end), stack, name string] EvUserLog = 48 // trace.Log [timestamp, internal id, key string id, stack, value string] EvCPUSample = 49 // CPU profiling sample [timestamp, stack, real timestamp, real P id (-1 when absent), goroutine id] EvCount = 50 )
Event types in the trace. Verbatim copy from src/runtime/trace.go with the "trace" prefix removed.
Variables ¶
View Source
var BreakTimestampsForTesting bool
BreakTimestampsForTesting causes the parser to randomly alter timestamps (for testing of broken cputicks).
View Source
var ErrTimeOrder = fmt.Errorf("time stamps out of order")
ErrTimeOrder is returned by Parse when the trace contains time stamps that do not respect actual event ordering.
View Source
var EventDescriptions = [EvCount]struct { Name string minVersion int Stack bool Args []string SArgs []string // string arguments }{ EvNone: {"None", 1005, false, []string{}, nil}, EvBatch: {"Batch", 1005, false, []string{"p", "ticks"}, nil}, EvFrequency: {"Frequency", 1005, false, []string{"freq"}, nil}, EvStack: {"Stack", 1005, false, []string{"id", "siz"}, nil}, EvGomaxprocs: {"Gomaxprocs", 1005, true, []string{"procs"}, nil}, EvProcStart: {"ProcStart", 1005, false, []string{"thread"}, nil}, EvProcStop: {"ProcStop", 1005, false, []string{}, nil}, EvGCStart: {"GCStart", 1005, true, []string{"seq"}, nil}, EvGCDone: {"GCDone", 1005, false, []string{}, nil}, EvGCSTWStart: {"GCSTWStart", 1005, false, []string{"kindid"}, []string{"kind"}}, EvGCSTWDone: {"GCSTWDone", 1005, false, []string{}, nil}, EvGCSweepStart: {"GCSweepStart", 1005, true, []string{}, nil}, EvGCSweepDone: {"GCSweepDone", 1005, false, []string{"swept", "reclaimed"}, nil}, EvGoCreate: {"GoCreate", 1005, true, []string{"g", "stack"},