From f244a1471d468eb35fb982cd6b4518d38bebf678 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 1 Apr 2015 13:47:35 -0400 Subject: runtime: add cumulative GC CPU % to gctrace line This tracks both total CPU time used by GC and the total time available to all Ps since the beginning of the program and uses this to derive a cumulative CPU usage percent for the gctrace line. Change-Id: Ica85372b8dd45f7621909b325d5ac713a9b0d015 Reviewed-on: https://go-review.googlesource.com/8350 Reviewed-by: Russ Cox --- src/runtime/runtime2.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/runtime/runtime2.go') diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go index 0d3e542882..6a2c52143f 100644 --- a/src/runtime/runtime2.go +++ b/src/runtime/runtime2.go @@ -421,6 +421,9 @@ type schedt struct { lastpoll uint64 profilehz int32 // cpu profiling rate + + procresizetime int64 // nanotime() of last change to gomaxprocs + totaltime int64 // ∫gomaxprocs dt up to procresizetime } // The m->locked word holds two pieces of state counting active calls to LockOSThread/lockOSThread. -- cgit v1.3-5-g9baa