Commit 1ccc577b authored by Austin Clements's avatar Austin Clements

runtime: include heap goal in gctrace line

This may or may not be useful to the end user, but it's incredibly
useful for us to understand the behavior of the pacer. Currently this
is fairly easy (though not trivial) to derive from the other heap
stats we print, but we're about to change how we compute the goal,
which will make it much harder to derive.

Change-Id: I796ef233d470c01f606bd9929820c01ece1f585a
Reviewed-on: https://go-review.googlesource.com/9176Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
parent 1f39beb0
......@@ -684,7 +684,7 @@ func gc(mode int) {
// debug.gctrace variables
var stwprocs, maxprocs int32
var tSweepTerm, tScan, tInstallWB, tMark, tMarkTerm int64
var heap0, heap1, heap2 uint64
var heap0, heap1, heap2, heapGoal uint64
// Ok, we're doing it! Stop everybody else
semacquire(&worldsema, false)
......@@ -732,6 +732,7 @@ func gc(mode int) {
if mode == gcBackgroundMode { // Do as much work concurrently as possible
gcController.startCycle()
heapGoal = gcController.heapGoal
systemstack(func() {
gcphase = _GCscan
......@@ -791,6 +792,7 @@ func gc(mode int) {
if debug.gctrace > 0 {
t := nanotime()
tScan, tInstallWB, tMark, tMarkTerm = t, t, t, t
heapGoal = heap0
}
}
......@@ -923,6 +925,7 @@ func gc(mode int) {
"/", gcController.idleMarkTime/1e6,
"+", markTermCpu/1e6, " ms cpu, ",
heap0>>20, "->", heap1>>20, "->", heap2>>20, " MB, ",
heapGoal>>20, " MB goal, ",
maxprocs, " P")
if mode != gcBackgroundMode {
print(" (forced)")
......
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