From 10083d80079055aa5e7946f3f4972fc4d8c296f1 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 2 Jun 2015 14:48:12 -0400 Subject: [PATCH] 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/10634 Reviewed-by: Rick Hudson Reviewed-by: Russ Cox --- src/runtime/mgc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index f5877e6847..71b083b29c 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -1006,7 +1006,7 @@ func gc(mode int) { var sbuf [24]byte printlock() print("gc #", memstats.numgc, - " @", string(itoaDiv(sbuf[:], uint64(tEnd-runtimeInitTime)/1e6, 3)), "s ", + " @", string(itoaDiv(sbuf[:], uint64(tSweepTerm-runtimeInitTime)/1e6, 3)), "s ", util, "%: ") prev := tSweepTerm for i, ns := range []int64{tScan, tInstallWB, tMark, tMarkTerm, tEnd} { -- 2.48.1