runtime: update gctrace line for new garbage collector

GODEBUG=gctrace=1 turns on a per-GC cycle trace line. The current line
is left over from the STW garbage collector and includes a lot of
information that is no longer meaningful for the concurrent GC and
doesn't include a lot of information that is important.

Replace this line with a new line designed for the new garbage
collector.

This new line is focused more on helping the user understand the
impact of the garbage collector on their program and less on telling
us, the runtime developers, everything that's happening inside
GC. It's designed to fit in 80 columns and intentionally omit some
potentially useful things that were in the old line. We might want a
"verbose" mode that adds information for us.

We'll be able to further simplify the line once we eliminate the STW
around enabling the write barrier. Then we'll have just one STW phase,
one concurrent phase, and one more STW phase, so we'll be able to
reduce the number of times from five to three.

Change-Id: Icc30939fe4576fb4491b4eac811649395727aa2a
Reviewed-on: https://go-review.googlesource.com/8208
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Austin Clements 2015-03-26 18:48:42 -04:00
parent 28f33b4a70
commit 24ee948269
2 changed files with 84 additions and 47 deletions

View file

@ -15,6 +15,9 @@ func main_init()
//go:linkname main_main main.main
func main_main()
// runtimeInitTime is the nanotime() at which the runtime started.
var runtimeInitTime int64
// The main goroutine.
func main() {
g := getg()
@ -32,6 +35,9 @@ func main() {
maxstacksize = 250000000
}
// Record when the world started.
runtimeInitTime = nanotime()
systemstack(func() {
newm(sysmon, nil)
})