Skip to content

Commit 78a0a31

Browse files
committed
[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: I8a6ac9c61e579e7a5ca7bdb0f3463f8ae8b9f863 Reviewed-on: https://go-review.googlesource.com/63270 Reviewed-by: Austin Clements <[email protected]> Run-TryBot: Austin Clements <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> (cherry picked from commit 96b1eff) Reviewed-on: https://go-review.googlesource.com/63310 Run-TryBot: Ian Lance Taylor <[email protected]>
1 parent 0993369 commit 78a0a31

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/runtime/cpuprof.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ func (p *cpuProfile) addExtra() {
160160
funcPC(_ExternalCode) + sys.PCQuantum,
161161
}
162162
cpuprof.log.write(nil, 0, hdr[:], lostStk[:])
163+
p.lostExtra = 0
163164
}
164165
}
165166

0 commit comments

Comments
 (0)