From: Michael Anthony Knyszek Date: Fri, 16 Jun 2023 18:28:22 +0000 (+0000) Subject: runtime: relate GODEBUG=gctrace output to runtime/metrics X-Git-Tag: go1.21rc3~2^2~79 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e45202f215;p=gostls13.git 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 TryBot-Result: Gopher Robot Run-TryBot: Michael Knyszek Auto-Submit: Michael Knyszek --- 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