lab.nexedi.com/kirr/go123@v0.0.0-20240207185015-8299741fa871/tracing/internal/xruntime/zruntime_g_go1.13.go (about) 1 // Code generated by g_typedef; DO NOT EDIT. 2 3 //go:build go1.13 && !go1.14 4 // +build go1.13,!go1.14 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 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 muintptr 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 ancestors *[]ancestorInfo // ancestor information goroutine(s) that created this goroutine (only used if debug.tracebackancestors) 55 startpc uintptr // pc of goroutine function 56 racectx uintptr 57 waiting *sudog // sudog structures this g is waiting on (that have a valid elem ptr); in lock order 58 cgoCtxt []uintptr // cgo traceback context 59 labels unsafe.Pointer // profiler labels 60 timer *timer // cached timer for time.Sleep 61 selectDone uint32 // are we participating in a select and did someone win the race? 62 63 // gcAssistBytes is this G's GC assist credit in terms of 64 // bytes allocated. If this is positive, then the G has credit 65 // to allocate gcAssistBytes bytes without assisting. If this 66 // is negative, then the G must correct this by performing 67 // scan work. We track this in bytes to make it fast to update 68 // and check for debt in the malloc hot path. The assist ratio 69 // determines how this corresponds to scan work debt. 70 gcAssistBytes int64 71 } 72 type stack struct { 73 lo uintptr 74 hi uintptr 75 } 76 type _panic struct { 77 argp unsafe.Pointer // pointer to arguments of deferred call run during panic; cannot move - known to liblink 78 arg interface{} // argument to panic 79 link *_panic // link to earlier panic 80 recovered bool // whether this panic is over 81 aborted bool // the panic was aborted 82 } 83 type _defer struct { 84 siz int32 // includes both arguments and results 85 started bool 86 heap bool 87 sp uintptr // sp at time of defer 88 pc uintptr 89 fn *funcval 90 _panic *_panic // panic that is running defer 91 link *_defer 92 } 93 type gobuf struct { 94 // The offsets of sp, pc, and g are known to (hard-coded in) libmach. 95 // 96 // ctxt is unusual with respect to GC: it may be a 97 // heap-allocated funcval, so GC needs to track it, but it 98 // needs to be set and cleared from assembly, where it's 99 // difficult to have write barriers. However, ctxt is really a 100 // saved, live register, and we only ever exchange it between 101 // the real register and the gobuf. Hence, we treat it as a 102 // root during stack scanning, which means assembly that saves 103 // and restores it doesn't need write barriers. It's still 104 // typed as a pointer so that any other writes from Go get 105 // write barriers. 106 sp uintptr 107 pc uintptr 108 g guintptr 109 ctxt unsafe.Pointer 110 ret uintreg 111 lr uintptr 112 bp uintptr // for GOEXPERIMENT=framepointer 113 } 114 type funcval struct { 115 fn uintptr 116 } 117 type timer struct { 118 tb *timersBucket // the bucket the timer lives in 119 i int // heap index 120 121 // Timer wakes up at when, and then at when+period, ... (period > 0 only) 122 // each time calling f(arg, now) in the timer goroutine, so f must be 123 // a well-behaved function and not block. 124 when int64 125 period int64 126 f func(interface{}, uintptr) 127 arg interface{} 128 seq uintptr 129 } 130 type guintptr uintptr 131 type puintptr uintptr 132 type muintptr uintptr 133 type waitReason uint8 134 type ancestorInfo struct { 135 pcs []uintptr // pcs from the stack of this goroutine 136 goid int64 // goroutine id of this goroutine; original goroutine possibly dead 137 gopc uintptr // pc of go statement that created this goroutine 138 } 139 type uintreg uint // FIXME wrong on amd64p32 140 type m struct{} // FIXME stub 141 type sudog struct{} // FIXME stub 142 type timersBucket struct{} // FIXME stub