]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: when gcpacertrace > 0, print information about assist ratio
authorAustin Clements <austin@google.com>
Mon, 3 Aug 2015 21:45:44 +0000 (17:45 -0400)
committerAustin Clements <austin@google.com>
Tue, 4 Aug 2015 18:54:46 +0000 (18:54 +0000)
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 <rlh@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/mgc.go

index c50d68e432a30b79df9dcaa9ba91ec4089bf2240..b1fbdc91bb57a03650131de31ff45b7b055a4ae6 100644 (file)
@@ -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()