1
0
mirror of https://github.com/golang/go synced 2024-11-17 05:54:46 -07:00

runtime: use profile data before advancing index

Fixes #52704

Change-Id: Ia2104c62d7ea9d67469144948b2ceb5d9f1313b3
Reviewed-on: https://go-review.googlesource.com/c/go/+/404054
Run-TryBot: Rhys Hiltner <rhys@justin.tv>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
This commit is contained in:
Rhys Hiltner 2022-05-04 07:26:21 -07:00 committed by Bryan Mills
parent 0e90ba9335
commit 1926fa5f84

View File

@ -745,6 +745,7 @@ func traceReadCPU() {
}
goid := data[3]
stk := data[4:data[0]]
empty := len(stk) == 1 && data[2] == 0 && data[3] == 0
data = data[data[0]:]
// No support here for reporting goroutine tags at the moment; if
// that information is to be part of the execution trace, we'd
@ -752,7 +753,7 @@ func traceReadCPU() {
// change, instead of only seeing them when we get a CPU sample.
tags = tags[1:]
if len(stk) == 1 && data[2] == 0 && data[3] == 0 {
if empty {
// Looks like an overflow record from the profBuf. Not much to
// do here, we only want to report full records.
//