runtime/trace: record HeapGoal when StartTrace

Fixes #52517

Change-Id: I06aa6112f14f264360c3bb0ffd4e1cd54ad22514
Reviewed-on: https://go-review.googlesource.com/c/go/+/401777
Reviewed-by: hopehook <hopehook@golangcn.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
Leonard Wang 2022-04-24 15:01:22 +08:00 committed by Gopher Robot
parent 4f5859c046
commit 192814985d
1 changed files with 3 additions and 0 deletions

View File

@ -318,6 +318,9 @@ func StartTrace() error {
unlock(&sched.sysmonlock) unlock(&sched.sysmonlock)
// Record the current state of HeapGoal to avoid information loss in trace.
traceHeapGoal()
startTheWorldGC() startTheWorldGC()
return nil return nil
} }