Commit 10083d80 authored by Austin Clements's avatar Austin Clements

runtime: print start of GC cycle in gctrace, rather than end

Currently the GODEBUG=gctrace=1 trace line includes "@n.nnns" to
indicate the time that the GC cycle ended relative to the time the
program started. This was meant to be consistent with the utilization
as of the end of the cycle, which is printed next on the trace line,
but it winds up just being confusing and unexpected.

Change the trace line to include the time that the GC cycle started
relative to the time the program started.

Change-Id: I7d64580cd696eb17540716d3e8a74a9d6ae50650
Reviewed-on: https://go-review.googlesource.com/10634Reviewed-by: default avatarRick Hudson <rlh@golang.org>
Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent f9ed2f75
...@@ -1006,7 +1006,7 @@ func gc(mode int) { ...@@ -1006,7 +1006,7 @@ func gc(mode int) {
var sbuf [24]byte var sbuf [24]byte
printlock() printlock()
print("gc #", memstats.numgc, print("gc #", memstats.numgc,
" @", string(itoaDiv(sbuf[:], uint64(tEnd-runtimeInitTime)/1e6, 3)), "s ", " @", string(itoaDiv(sbuf[:], uint64(tSweepTerm-runtimeInitTime)/1e6, 3)), "s ",
util, "%: ") util, "%: ")
prev := tSweepTerm prev := tSweepTerm
for i, ns := range []int64{tScan, tInstallWB, tMark, tMarkTerm, tEnd} { for i, ns := range []int64{tScan, tInstallWB, tMark, tMarkTerm, tEnd} {
......
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