aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2023-06-16 18:28:22 +0000
committerMichael Knyszek <mknyszek@google.com>2023-06-21 15:57:28 +0000
commite45202f2154839f713b603fd6e5f8a8ad8d527e0 (patch)
tree9da85d2de7675f54ff60568de8811aad6b57f3e4
parent36edde9d9f811477e1d5bd0090f4a061ba823db9 (diff)
downloadgo-e45202f2154839f713b603fd6e5f8a8ad8d527e0.tar.gz
go-e45202f2154839f713b603fd6e5f8a8ad8d527e0.zip
runtime: relate GODEBUG=gctrace output to runtime/metrics
There's more I could list here, but the mapping becomes more complicated and more fragile. I think this is sufficient to start with. Fixes #46846. Change-Id: I6803486a64888b2f38e244b8e2175ad064d648ed Reviewed-on: https://go-review.googlesource.com/c/go/+/504115 Reviewed-by: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Knyszek <mknyszek@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com>
-rw-r--r--src/runtime/extern.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/runtime/extern.go b/src/runtime/extern.go
index ac07119cb9..26dcf0bd52 100644
--- a/src/runtime/extern.go
+++ b/src/runtime/extern.go
@@ -87,7 +87,8 @@ It is a comma-separated list of name=val pairs setting these named variables:
gctrace: setting gctrace=1 causes the garbage collector to emit a single line to standard
error at each collection, summarizing the amount of memory collected and the
- length of the pause. The format of this line is subject to change.
+ length of the pause. The format of this line is subject to change. Included in
+ the explanation below is also the relevant runtime/metrics metric for each field.
Currently, it is:
gc # @#s #%: #+#+# ms clock, #+#/#/#+# ms cpu, #->#-># MB, # MB goal, # MB stacks, #MB globals, # P
where the fields are as follows:
@@ -95,11 +96,11 @@ It is a comma-separated list of name=val pairs setting these named variables:
@#s time in seconds since program start
#% percentage of time spent in GC since program start
#+...+# wall-clock/CPU times for the phases of the GC
- #->#-># MB heap size at GC start, at GC end, and live heap
- # MB goal goal heap size
- # MB stacks estimated scannable stack size
- # MB globals scannable global size
- # P number of processors used
+ #->#-># MB heap size at GC start, at GC end, and live heap, or /gc/scan/heap:bytes
+ # MB goal goal heap size, or /gc/heap/goal:bytes
+ # MB stacks estimated scannable stack size, or /gc/scan/stack:bytes
+ # MB globals scannable global size, or /gc/scan/globals:bytes
+ # P number of processors used, or /sched/gomaxprocs:threads
The phases are stop-the-world (STW) sweep termination, concurrent
mark and scan, and STW mark termination. The CPU times
for mark/scan are broken down in to assist time (GC performed in