From f9dc3382ad8b3ec330b41297053e14dd199d3b5f Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 3 Aug 2015 17:45:44 -0400 Subject: [PATCH] runtime: when gcpacertrace > 0, print information about assist ratio This was useful in debugging the mutator assist behavior for #11911, and it fits with the other gcpacertrace output. Change-Id: I1e25590bb4098223a160de796578bd11086309c7 Reviewed-on: https://go-review.googlesource.com/13046 Reviewed-by: Rick Hudson Reviewed-by: Russ Cox --- src/runtime/mgc.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index c50d68e432..b1fbdc91bb 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -441,6 +441,15 @@ func (c *gcControllerState) startCycle() { // throughout the cycle. c.revise() + if debug.gcpacertrace > 0 { + print("pacer: assist ratio=", c.assistRatio, + " (scan ", memstats.heap_scan>>20, " MB in ", + work.initialHeapLive>>20, "->", + c.heapGoal>>20, " MB)", + " workers=", c.dedicatedMarkWorkersNeeded, + "+", c.fractionalMarkWorkersNeeded, "\n") + } + // Set up a timer to revise periodically c.reviseTimer.f = func(interface{}, uintptr) { gcController.revise() -- 2.50.0