Skip to content

Commit

Permalink
runtime: move goroutine stack exists events after span events
Browse files Browse the repository at this point in the history
Preserving an ordering wherein spans are always named before their
constituents makes parsing much more straightforward.

Change-Id: Ida8764801a6c516d672ba343e4ce01b66ce9b427
Reviewed-on: https://go-review.googlesource.com/c/go/+/586999
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
  • Loading branch information
mknyszek authored and gopherbot committed May 22, 2024
1 parent 1110c40 commit b6fa505
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/runtime/traceallocfree.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ func traceSnapshotMemory(gen uintptr) {
throw("traceSnapshotMemory: tracing is not enabled")
}

// Write out all the goroutine stacks.
forEachGRace(func(gp *g) {
trace.GoroutineStackExists(gp.stack.lo, gp.stack.hi-gp.stack.lo)
})

// Write out all the heap spans and heap objects.
for _, s := range mheap_.allspans {
if s.state.get() == mSpanDead {
Expand All @@ -77,6 +72,11 @@ func traceSnapshotMemory(gen uintptr) {
abits.advance()
}
}

// Write out all the goroutine stacks.
forEachGRace(func(gp *g) {
trace.GoroutineStackExists(gp.stack.lo, gp.stack.hi-gp.stack.lo)
})
traceRelease(trace)
}

Expand Down

0 comments on commit b6fa505

Please sign in to comment.