@@ -358,20 +358,20 @@ type g struct {
358358 atomicstatus uint32
359359 stackLock uint32 // sigprof/scang lock; TODO: fold in to atomicstatus
360360 goid int64
361+ waitsince int64 // approx time when the g become blocked
362+ waitreason string // if status==Gwaiting
361363 schedlink guintptr
362- waitsince int64 // approx time when the g become blocked
363- waitreason waitReason // if status==Gwaiting
364- preempt bool // preemption signal, duplicates stackguard0 = stackpreempt
365- paniconfault bool // panic (instead of crash) on unexpected fault address
366- preemptscan bool // preempted g does scan for gc
367- gcscandone bool // g has scanned stack; protected by _Gscan bit in status
368- gcscanvalid bool // false at start of gc cycle, true if G has not run since last scan; TODO: remove?
369- throwsplit bool // must not split stack
370- raceignore int8 // ignore race detection events
371- sysblocktraced bool // StartTrace has emitted EvGoInSyscall about this goroutine
372- sysexitticks int64 // cputicks when syscall has returned (for tracing)
373- traceseq uint64 // trace event sequencer
374- tracelastp puintptr // last P emitted an event for this goroutine
364+ preempt bool // preemption signal, duplicates stackguard0 = stackpreempt
365+ paniconfault bool // panic (instead of crash) on unexpected fault address
366+ preemptscan bool // preempted g does scan for gc
367+ gcscandone bool // g has scanned stack; protected by _Gscan bit in status
368+ gcscanvalid bool // false at start of gc cycle, true if G has not run since last scan; TODO: remove?
369+ throwsplit bool // must not split stack
370+ raceignore int8 // ignore race detection events
371+ sysblocktraced bool // StartTrace has emitted EvGoInSyscall about this goroutine
372+ sysexitticks int64 // cputicks when syscall has returned (for tracing)
373+ traceseq uint64 // trace event sequencer
374+ tracelastp puintptr // last P emitted an event for this goroutine
375375 lockedm muintptr
376376 sig uint32
377377 writebuf []byte
@@ -752,69 +752,6 @@ const (
752752// The maximum number of frames we print for a traceback
753753const _TracebackMaxFrames = 100
754754
755- // A waitReason explains why a goroutine has been stopped.
756- // See gopark. Do not re-use waitReasons, add new ones.
757- type waitReason uint8
758-
759- const (
760- waitReasonZero waitReason = iota // ""
761- waitReasonGCAssistMarking // "GC assist marking"
762- waitReasonIOWait // "IO wait"
763- waitReasonChanReceiveNilChan // "chan receive (nil chan)"
764- waitReasonChanSendNilChan // "chan send (nil chan)"
765- waitReasonDumpingHeap // "dumping heap"
766- waitReasonGarbageCollection // "garbage collection"
767- waitReasonGarbageCollectionScan // "garbage collection scan"
768- waitReasonPanicWait // "panicwait"
769- waitReasonSelect // "select"
770- waitReasonSelectNoCases // "select (no cases)"
771- waitReasonGCAssistWait // "GC assist wait"
772- waitReasonGCSweepWait // "GC sweep wait"
773- waitReasonChanReceive // "chan receive"
774- waitReasonChanSend // "chan send"
775- waitReasonFinalizerWait // "finalizer wait"
776- waitReasonForceGGIdle // "force gc (idle)"
777- waitReasonSemacquire // "semacquire"
778- waitReasonSleep // "sleep"
779- waitReasonTimerGoroutineIdle // "timer goroutine (idle)"
780- waitReasonTraceReaderBlocked // "trace reader (blocked)"
781- waitReasonWaitForGCCycle // "wait for GC cycle"
782- waitReasonGCWorkerIdle // "GC worker (idle)"
783- )
784-
785- var waitReasonStrings = [... ]string {
786- waitReasonZero : "" ,
787- waitReasonGCAssistMarking : "GC assist marking" ,
788- waitReasonIOWait : "IO wait" ,
789- waitReasonChanReceiveNilChan : "chan receive (nil chan)" ,
790- waitReasonChanSendNilChan : "chan send (nil chan)" ,
791- waitReasonDumpingHeap : "dumping heap" ,
792- waitReasonGarbageCollection : "garbage collection" ,
793- waitReasonGarbageCollectionScan : "garbage collection scan" ,
794- waitReasonPanicWait : "panicwait" ,
795- waitReasonSelect : "select" ,
796- waitReasonSelectNoCases : "select (no cases)" ,
797- waitReasonGCAssistWait : "GC assist wait" ,
798- waitReasonGCSweepWait : "GC sweep wait" ,
799- waitReasonChanReceive : "chan receive" ,
800- waitReasonChanSend : "chan send" ,
801- waitReasonFinalizerWait : "finalizer wait" ,
802- waitReasonForceGGIdle : "force gc (idle)" ,
803- waitReasonSemacquire : "semacquire" ,
804- waitReasonSleep : "sleep" ,
805- waitReasonTimerGoroutineIdle : "timer goroutine (idle)" ,
806- waitReasonTraceReaderBlocked : "trace reader (blocked)" ,
807- waitReasonWaitForGCCycle : "wait for GC cycle" ,
808- waitReasonGCWorkerIdle : "GC worker (idle)" ,
809- }
810-
811- func (w waitReason ) String () string {
812- if w < 0 || w >= waitReason (len (waitReasonStrings )) {
813- return "unknown wait reason"
814- }
815- return waitReasonStrings [w ]
816- }
817-
818755var (
819756 allglen uintptr
820757 allm * m
0 commit comments