Commit 65c399f0 authored by Kirill Smelkov's avatar Kirill Smelkov

tracing/runtime: Add support for Go1.10 (preliminary)

Preliminary because Go1.10 has not been released yet, so
zruntime_g_go1.10.go will need to be potentially regenerated after
the release.
parent 5728e4d9
......@@ -48,9 +48,14 @@ typedef_g_fixed() {
echo "type guintptr uintptr // XXX stub"
echo "type puintptr uintptr // XXX stub"
echo "type muintptr uintptr // XXX stub"
echo "type uintreg uint // FIXME wrong on amd64p32"
echo "type m struct {} // FIXME stub"
echo "type sudog struct {} // FIXME stub"
if (( $govern >= 110 )); then
echo "type timersBucket struct {} // FIXME stub"
fi
}
......@@ -70,7 +75,7 @@ gen_zruntime() {
# main driver
gov="go18 go"
gov="go18 go19 go110"
for g in $gov; do
goset $g
......
// Code generated by g_typedef; DO NOT EDIT.
// +build go1.10,!go1.11
package xruntime
import "unsafe"
type g struct {
// Stack parameters.
// stack describes the actual stack memory: [stack.lo, stack.hi).
// stackguard0 is the stack pointer compared in the Go stack growth prologue.
// It is stack.lo+StackGuard normally, but can be StackPreempt to trigger a preemption.
// stackguard1 is the stack pointer compared in the C stack growth prologue.
// It is stack.lo+StackGuard on g0 and gsignal stacks.
// It is ~0 on other goroutine stacks, to trigger a call to morestackc (and crash).
stack stack // offset known to runtime/cgo
stackguard0 uintptr // offset known to liblink
stackguard1 uintptr // offset known to liblink
_panic *_panic // innermost panic - offset known to liblink
_defer *_defer // innermost defer
m *m // current m; offset known to arm liblink
sched gobuf
syscallsp uintptr // if status==Gsyscall, syscallsp = sched.sp to use during gc
syscallpc uintptr // if status==Gsyscall, syscallpc = sched.pc to use during gc
stktopsp uintptr // expected sp at top of stack, to check in traceback
param unsafe.Pointer // passed parameter on wakeup
atomicstatus uint32
stackLock uint32 // sigprof/scang lock; TODO: fold in to atomicstatus
goid int64
waitsince int64 // approx time when the g become blocked
waitreason string // if status==Gwaiting
schedlink guintptr
preempt bool // preemption signal, duplicates stackguard0 = stackpreempt
paniconfault bool // panic (instead of crash) on unexpected fault address
preemptscan bool // preempted g does scan for gc
gcscandone bool // g has scanned stack; protected by _Gscan bit in status
gcscanvalid bool // false at start of gc cycle, true if G has not run since last scan; TODO: remove?
throwsplit bool // must not split stack
raceignore int8 // ignore race detection events
sysblocktraced bool // StartTrace has emitted EvGoInSyscall about this goroutine
sysexitticks int64 // cputicks when syscall has returned (for tracing)
traceseq uint64 // trace event sequencer
tracelastp puintptr // last P emitted an event for this goroutine
lockedm muintptr
sig uint32
writebuf []byte
sigcode0 uintptr
sigcode1 uintptr
sigpc uintptr
gopc uintptr // pc of go statement that created this goroutine
startpc uintptr // pc of goroutine function
racectx uintptr
waiting *sudog // sudog structures this g is waiting on (that have a valid elem ptr); in lock order
cgoCtxt []uintptr // cgo traceback context
labels unsafe.Pointer // profiler labels
timer *timer // cached timer for time.Sleep
selectDone uint32 // are we participating in a select and did someone win the race?
// gcAssistBytes is this G's GC assist credit in terms of
// bytes allocated. If this is positive, then the G has credit
// to allocate gcAssistBytes bytes without assisting. If this
// is negative, then the G must correct this by performing
// scan work. We track this in bytes to make it fast to update
// and check for debt in the malloc hot path. The assist ratio
// determines how this corresponds to scan work debt.
gcAssistBytes int64
}
type stack struct {
lo uintptr
hi uintptr
}
type _panic struct {
argp unsafe.Pointer // pointer to arguments of deferred call run during panic; cannot move - known to liblink
arg interface{} // argument to panic
link *_panic // link to earlier panic
recovered bool // whether this panic is over
aborted bool // the panic was aborted
}
type _defer struct {
siz int32
started bool
sp uintptr // sp at time of defer
pc uintptr
fn *funcval
_panic *_panic // panic that is running defer
link *_defer
}
type gobuf struct {
// The offsets of sp, pc, and g are known to (hard-coded in) libmach.
//
// ctxt is unusual with respect to GC: it may be a
// heap-allocated funcval, so GC needs to track it, but it
// needs to be set and cleared from assembly, where it's
// difficult to have write barriers. However, ctxt is really a
// saved, live register, and we only ever exchange it between
// the real register and the gobuf. Hence, we treat it as a
// root during stack scanning, which means assembly that saves
// and restores it doesn't need write barriers. It's still
// typed as a pointer so that any other writes from Go get
// write barriers.
sp uintptr
pc uintptr
g guintptr
ctxt unsafe.Pointer
ret uintreg
lr uintptr
bp uintptr // for GOEXPERIMENT=framepointer
}
type funcval struct {
fn uintptr
}
type timer struct {
tb *timersBucket // the bucket the timer lives in
i int // heap index
// Timer wakes up at when, and then at when+period, ... (period > 0 only)
// each time calling f(arg, now) in the timer goroutine, so f must be
// a well-behaved function and not block.
when int64
period int64
f func(interface{}, uintptr)
arg interface{}
seq uintptr
}
type guintptr uintptr // XXX stub
type puintptr uintptr // XXX stub
type muintptr uintptr // XXX stub
type uintreg uint // FIXME wrong on amd64p32
type m struct {} // FIXME stub
type sudog struct {} // FIXME stub
type timersBucket struct {} // FIXME stub
......@@ -134,6 +134,7 @@ type stkbar struct {
}
type guintptr uintptr // XXX stub
type puintptr uintptr // XXX stub
type muintptr uintptr // XXX stub
type uintreg uint // FIXME wrong on amd64p32
type m struct {} // FIXME stub
type sudog struct {} // FIXME stub
......@@ -122,6 +122,7 @@ type timer struct {
}
type guintptr uintptr // XXX stub
type puintptr uintptr // XXX stub
type muintptr uintptr // XXX stub
type uintreg uint // FIXME wrong on amd64p32
type m struct {} // FIXME stub
type sudog struct {} // FIXME stub
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment