mirror of https://github.com/golang/go.git
runtime: output number of goroutines in GC trace
Example output: gc26(1): 1+0+1038+0 us, 0 -> 1 MB, 19074 (88777-69703) objects, 5 gs, 184/0/0 sweeps, 0(0) handoff, 0(0) steal, 0/0/0 yields It's useful to understand long scan times, because goroutine traceback is slow. LGTM=khr R=golang-codereviews, khr CC=golang-codereviews, rsc https://golang.org/cl/136310044
This commit is contained in:
parent
a2910958a2
commit
ed7db89b90
|
|
@ -1401,11 +1401,13 @@ gc(struct gc_args *args)
|
|||
stats.nsleep += work.markfor->nsleep;
|
||||
|
||||
runtime·printf("gc%d(%d): %D+%D+%D+%D us, %D -> %D MB, %D (%D-%D) objects,"
|
||||
" %d goroutines,"
|
||||
" %d/%d/%d sweeps,"
|
||||
" %D(%D) handoff, %D(%D) steal, %D/%D/%D yields\n",
|
||||
mstats.numgc, work.nproc, (t1-t0)/1000, (t2-t1)/1000, (t3-t2)/1000, (t4-t3)/1000,
|
||||
heap0>>20, heap1>>20, obj,
|
||||
mstats.nmalloc, mstats.nfree,
|
||||
runtime·gcount(),
|
||||
work.nspan, runtime·sweep.nbgsweep, runtime·sweep.npausesweep,
|
||||
stats.nhandoff, stats.nhandoffcnt,
|
||||
work.markfor->nsteal, work.markfor->nstealcnt,
|
||||
|
|
|
|||
Loading…
Reference in New Issue