lab.nexedi.com/kirr/go123@v0.0.0-20240207185015-8299741fa871/tracing/internal/xruntime/zruntime_g_go1.14.go (about) 1 // Code generated by g_typedef; DO NOT EDIT. 2 3 //go:build go1.14 && !go1.15 4 // +build go1.14,!go1.15 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 schedlink guintptr 34 waitsince int64 // approx time when the g become blocked 35 waitreason waitReason // if status==Gwaiting 36 37 preempt bool // preemption signal, duplicates stackguard0 = stackpreempt 38 preemptStop bool // transition to _Gpreempted on preemption; otherwise, just deschedule 39 preemptShrink bool // shrink stack at synchronous safe point 40 41 // asyncSafePoint is set if g is stopped at an asynchronous 42 // safe point. This means there are frames on the stack 43 // without precise pointer information. 44 asyncSafePoint bool 45 46 paniconfault bool // panic (instead of crash) on unexpected fault address 47 gcscandone bool // g has scanned stack; protected by _Gscan bit in status 48 throwsplit bool // must not split stack 49 // activeStackChans indicates that there are unlocked channels 50 // pointing into this goroutine's stack. If true, stack 51 // copying needs to acquire channel locks to protect these 52 // areas of the stack. 53 activeStackChans bool 54 // parkingOnChan indicates that the goroutine is about to 55 // park on a chansend or chanrecv. Used to signal an unsafe point 56 // for stack shrinking. It's a boolean value, but is updated atomically. 57 parkingOnChan uint8 58 59 raceignore int8 // ignore race detection events 60 sysblocktraced bool // StartTrace has emitted EvGoInSyscall about this goroutine 61 sysexitticks int64 // cputicks when syscall has returned (for tracing) 62 traceseq uint64 // trace event sequencer 63 tracelastp puintptr // last P emitted an event for this goroutine 64 lockedm muintptr 65 sig uint32 66 writebuf []byte 67 sigcode0 uintptr 68 sigcode1 uintptr 69 sigpc uintptr 70 gopc uintptr // pc of go statement that created this goroutine 71 ancestors *[]ancestorInfo // ancestor information goroutine(s) that created this goroutine (only used if debug.tracebackancestors) 72 startpc uintptr // pc of goroutine function 73 racectx uintptr 74 waiting *sudog // sudog structures this g is waiting on (that have a valid elem ptr); in lock order 75 cgoCtxt []uintptr // cgo traceback context 76 labels unsafe.Pointer // profiler labels 77 timer *timer // cached timer for time.Sleep 78 selectDone uint32 // are we participating in a select and did someone win the race? 79 80 // gcAssistBytes is this G's GC assist credit in terms of 81 // bytes allocated. If this is positive, then the G has credit 82 // to allocate gcAssistBytes bytes without assisting. If this 83 // is negative, then the G must correct this by performing 84 // scan work. We track this in bytes to make it fast to update 85 // and check for debt in the malloc hot path. The assist ratio 86 // determines how this corresponds to scan work debt. 87 gcAssistBytes int64 88 } 89 type stack struct { 90 lo uintptr 91 hi uintptr 92 } 93 type _panic struct { 94 argp unsafe.Pointer // pointer to arguments of deferred call run during panic; cannot move - known to liblink 95 arg interface{} // argument to panic 96 link *_panic // link to earlier panic 97 pc uintptr // where to return to in runtime if this panic is bypassed 98 sp unsafe.Pointer // where to return to in runtime if this panic is bypassed 99 recovered bool // whether this panic is over 100 aborted bool // the panic was aborted 101 goexit bool 102 } 103 type _defer struct { 104 siz int32 // includes both arguments and results 105 started bool 106 heap bool 107 // openDefer indicates that this _defer is for a frame with open-coded 108 // defers. We have only one defer record for the entire frame (which may 109 // currently have 0, 1, or more defers active). 110 openDefer bool 111 sp uintptr // sp at time of defer 112 pc uintptr // pc at time of defer 113 fn *funcval // can be nil for open-coded defers 114 _panic *_panic // panic that is running defer 115 link *_defer 116 117 // If openDefer is true, the fields below record values about the stack 118 // frame and associated function that has the open-coded defer(s). sp 119 // above will be the sp for the frame, and pc will be address of the 120 // deferreturn call in the function. 121 fd unsafe.Pointer // funcdata for the function associated with the frame 122 varp uintptr // value of varp for the stack frame 123 // framepc is the current pc associated with the stack frame. Together, 124 // with sp above (which is the sp associated with the stack frame), 125 // framepc/sp can be used as pc/sp pair to continue a stack trace via 126 // gentraceback(). 127 framepc uintptr 128 } 129 type gobuf struct { 130 // The offsets of sp, pc, and g are known to (hard-coded in) libmach. 131 // 132 // ctxt is unusual with respect to GC: it may be a 133 // heap-allocated funcval, so GC needs to track it, but it 134 // needs to be set and cleared from assembly, where it's 135 // difficult to have write barriers. However, ctxt is really a 136 // saved, live register, and we only ever exchange it between 137 // the real register and the gobuf. Hence, we treat it as a 138 // root during stack scanning, which means assembly that saves 139 // and restores it doesn't need write barriers. It's still 140 // typed as a pointer so that any other writes from Go get 141 // write barriers. 142 sp uintptr 143 pc uintptr 144 g guintptr 145 ctxt unsafe.Pointer 146 ret uintreg 147 lr uintptr 148 bp uintptr // for GOEXPERIMENT=framepointer 149 } 150 type funcval struct { 151 fn uintptr 152 } 153 type timer struct { 154 // If this timer is on a heap, which P's heap it is on. 155 // puintptr rather than *p to match uintptr in the versions 156 // of this struct defined in other packages. 157 pp puintptr 158 159 // Timer wakes up at when, and then at when+period, ... (period > 0 only) 160 // each time calling f(arg, now) in the timer goroutine, so f must be 161 // a well-behaved function and not block. 162 when int64 163 period int64 164 f func(interface{}, uintptr) 165 arg interface{} 166 seq uintptr 167 168 // What to set the when field to in timerModifiedXX status. 169 nextwhen int64 170 171 // The status field holds one of the values below. 172 status uint32 173 } 174 type guintptr uintptr 175 type puintptr uintptr 176 type muintptr uintptr 177 type waitReason uint8 178 type ancestorInfo struct { 179 pcs []uintptr // pcs from the stack of this goroutine 180 goid int64 // goroutine id of this goroutine; original goroutine possibly dead 181 gopc uintptr // pc of go statement that created this goroutine 182 } 183 type uintreg uint // FIXME wrong on amd64p32 184 type m struct{} // FIXME stub 185 type sudog struct{} // FIXME stub 186 type timersBucket struct{} // FIXME stub