lab.nexedi.com/kirr/go123@v0.0.0-20240207185015-8299741fa871/tracing/internal/xruntime/zruntime_g_go1.9.go (about) 1 // Code generated by g_typedef; DO NOT EDIT. 2 3 //go:build go1.9 && !go1.10 4 // +build go1.9,!go1.10 5 6 package xruntime 7 8 import "unsafe" 9 10 type g struct { 11 // Stack parameters. 12 // stack describes the actual stack memory: [stack.lo, stack.hi). 13 // stackguard0 is the stack pointer compared in the Go stack growth prologue. 14 // It is stack.lo+StackGuard normally, but can be StackPreempt to trigger a preemption. 15 // stackguard1 is the stack pointer compared in the C stack growth prologue. 16 // It is stack.lo+StackGuard on g0 and gsignal stacks. 17 // It is ~0 on other goroutine stacks, to trigger a call to morestackc (and crash). 18 stack stack // offset known to runtime/cgo 19 stackguard0 uintptr // offset known to liblink 20 stackguard1 uintptr // offset known to liblink 21 22 _panic *_panic // innermost panic - offset known to liblink 23 _defer *_defer // innermost defer 24 m *m // current m; offset known to arm liblink 25 sched gobuf 26 syscallsp uintptr // if status==Gsyscall, syscallsp = sched.sp to use during gc 27 syscallpc uintptr // if status==Gsyscall, syscallpc = sched.pc to use during gc 28 stktopsp uintptr // expected sp at top of stack, to check in traceback 29 param unsafe.Pointer // passed parameter on wakeup 30 atomicstatus uint32 31 stackLock uint32 // sigprof/scang lock; TODO: fold in to atomicstatus 32 goid int64 33 waitsince int64 // approx time when the g become blocked 34 waitreason string // if status==Gwaiting 35 schedlink guintptr 36 preempt bool // preemption signal, duplicates stackguard0 = stackpreempt 37 paniconfault bool // panic (instead of crash) on unexpected fault address 38 preemptscan bool // preempted g does scan for gc 39 gcscandone bool // g has scanned stack; protected by _Gscan bit in status 40 gcscanvalid bool // false at start of gc cycle, true if G has not run since last scan; TODO: remove? 41 throwsplit bool // must not split stack 42 raceignore int8 // ignore race detection events 43 sysblocktraced bool // StartTrace has emitted EvGoInSyscall about this goroutine 44 sysexitticks int64 // cputicks when syscall has returned (for tracing) 45 traceseq uint64 // trace event sequencer 46 tracelastp puintptr // last P emitted an event for this goroutine 47 lockedm *m 48 sig uint32 49 writebuf []byte 50 sigcode0 uintptr 51 sigcode1 uintptr 52 sigpc uintptr 53 gopc uintptr // pc of go statement that created this goroutine 54 startpc uintptr // pc of goroutine function 55 racectx uintptr 56 waiting *sudog // sudog structures this g is waiting on (that have a valid elem ptr); in lock order 57 cgoCtxt []uintptr // cgo traceback context 58 labels unsafe.Pointer // profiler labels 59 timer *timer // cached timer for time.Sleep 60 61 // gcAssistBytes is this G's GC assist credit in terms of 62 // bytes allocated. If this is positive, then the G has credit 63 // to allocate gcAssistBytes bytes without assisting. If this 64 // is negative, then the G must correct this by performing 65 // scan work. We track this in bytes to make it fast to update 66 // and check for debt in the malloc hot path. The assist ratio 67 // determines how this corresponds to scan work debt. 68 gcAssistBytes int64 69 } 70 type stack struct { 71 lo uintptr 72 hi uintptr 73 } 74 type _panic struct { 75 argp unsafe.Pointer // pointer to arguments of deferred call run during panic; cannot move - known to liblink 76 arg interface{} // argument to panic 77 link *_panic // link to earlier panic 78 recovered bool // whether this panic is over 79 aborted bool // the panic was aborted 80 } 81 type _defer struct { 82 siz int32 83 started bool 84 sp uintptr // sp at time of defer 85 pc uintptr 86 fn *funcval 87 _panic *_panic // panic that is running defer 88 link *_defer 89 } 90 type gobuf struct { 91 // The offsets of sp, pc, and g are known to (hard-coded in) libmach. 92 // 93 // ctxt is unusual with respect to GC: it may be a 94 // heap-allocated funcval so write require a write barrier, 95 // but gobuf needs to be cleared from assembly. We take 96 // advantage of the fact that the only path that uses a 97 // non-nil ctxt is morestack. As a result, gogo is the only 98 // place where it may not already be nil, so gogo uses an 99 // explicit write barrier. Everywhere else that resets the 100 // gobuf asserts that ctxt is already nil. 101 sp uintptr 102 pc uintptr 103 g guintptr 104 ctxt unsafe.Pointer // this has to be a pointer so that gc scans it 105 ret uintreg 106 lr uintptr 107 bp uintptr // for GOEXPERIMENT=framepointer 108 } 109 type funcval struct { 110 fn uintptr 111 } 112 type timer struct { 113 i int // heap index 114 115 // Timer wakes up at when, and then at when+period, ... (period > 0 only) 116 // each time calling f(arg, now) in the timer goroutine, so f must be 117 // a well-behaved function and not block. 118 when int64 119 period int64 120 f func(interface{}, uintptr) 121 arg interface{} 122 seq uintptr 123 } 124 type guintptr uintptr 125 type puintptr uintptr 126 type muintptr uintptr 127 type uintreg uint // FIXME wrong on amd64p32 128 type m struct{} // FIXME stub 129 type sudog struct{} // FIXME stub