// there's a paused gcWork, then
// that's a bug.
_p_.gcw.pauseGen = gcWorkPauseGen
+ // Capture the G's stack.
+ for i := range _p_.gcw.pauseStack {
+ _p_.gcw.pauseStack[i] = 0
+ }
+ callers(1, _p_.gcw.pauseStack[:])
}
})
casgstatus(gp, _Gwaiting, _Grunning)
// pauseGen causes put operations to spin while pauseGen ==
// gcWorkPauseGen if debugCachedWork is true.
pauseGen uint32
+
+ // pauseStack is the stack at which this P was paused if
+ // debugCachedWork is true.
+ pauseStack [16]uintptr
}
// Most of the methods of gcWork are go:nowritebarrierrec because the
for _, ptr := range ptrs {
gcDumpObject("ptrs", ptr, ^uintptr(0))
}
+ println("runtime: paused at")
+ for _, pc := range w.pauseStack {
+ if pc == 0 {
+ break
+ }
+ f := findfunc(pc)
+ if f.valid() {
+ // Obviously this doesn't
+ // relate to ancestor
+ // tracebacks, but this
+ // function prints what we
+ // want.
+ printAncestorTracebackFuncInfo(f, pc)
+ } else {
+ println("\tunknown PC ", hex(pc), "\n")
+ }
+ }
throw("throwOnGCWork")
}
}