aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Matloob <matloob@golang.org>2017-09-12 12:22:22 -0400
committerRuss Cox <rsc@golang.org>2017-10-25 20:23:55 +0000
commitf36b12657c71753029aeefa5e0af3c1607ffe9bb (patch)
treec7606b15bac80c48aec61ab23c4c05abffd0e318
parentdffc9319f187b8a993968833b3692fc31abbdf1e (diff)
downloadgo-f36b12657c71753029aeefa5e0af3c1607ffe9bb.tar.gz
go-f36b12657c71753029aeefa5e0af3c1607ffe9bb.zip
[release-branch.go1.9] runtime: in cpuProfile.addExtra, set p.lostExtra to 0 after flush
After the number of lost extra events are written to the the cpuprof log, the number of lost extra events should be set to zero, or else, the next time time addExtra is logged, lostExtra will be overcounted. This change resets lostExtra after its value is written to the log. Fixes #21836 Change-Id: I8a6ac9c61e579e7a5ca7bdb0f3463f8ae8b9f864 Reviewed-on: https://go-review.googlesource.com/63270 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/70974 Run-TryBot: Russ Cox <rsc@golang.org>
-rw-r--r--src/runtime/cpuprof.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/cpuprof.go b/src/runtime/cpuprof.go
index fb841a9f3d..e00dcb1bbd 100644
--- a/src/runtime/cpuprof.go
+++ b/src/runtime/cpuprof.go
@@ -160,6 +160,7 @@ func (p *cpuProfile) addExtra() {
funcPC(_ExternalCode) + sys.PCQuantum,
}
cpuprof.log.write(nil, 0, hdr[:], lostStk[:])
+ p.lostExtra = 0
}
}