aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXiangdong Ji <xiangdong.ji@gmail.com>2021-06-25 21:51:22 +0800
committerGopher Robot <gobot@golang.org>2022-11-08 21:50:06 +0000
commit8befe0e4083a2a61741f03fb4e4cc2814fe27c35 (patch)
treea448ef9ddcca4cd1be5fa3b5da410a43145a0e66 /src
parent2df6c1abce8cfd3f47ed5eb5a45733d7cbb53b4b (diff)
downloadgo-8befe0e4083a2a61741f03fb4e4cc2814fe27c35.tar.xz
runtime: fix uncondition calls to traceGCSTWDone
startTheWorldWithSema should call traceGCSTWDone only when the tracing is enabled. Change-Id: Ibc7181834f68af3923e4b2aee01a57492ab6213e Reviewed-on: https://go-review.googlesource.com/c/go/+/330835 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/mgc.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go
index 0cb507346a..69dc5433b1 100644
--- a/src/runtime/mgc.go
+++ b/src/runtime/mgc.go
@@ -879,7 +879,7 @@ top:
if restart {
getg().m.preemptoff = ""
systemstack(func() {
- now := startTheWorldWithSema(true)
+ now := startTheWorldWithSema(trace.enabled)
work.pauseNS += now - work.pauseStart
memstats.gcPauseDist.record(now - work.pauseStart)
})
@@ -1087,7 +1087,7 @@ func gcMarkTermination() {
throw("failed to set sweep barrier")
}
- systemstack(func() { startTheWorldWithSema(true) })
+ systemstack(func() { startTheWorldWithSema(trace.enabled) })
// Flush the heap profile so we can start a new cycle next GC.
// This is relatively expensive, so we don't do it with the