Skip to content

Commit b6fa505

Browse files
mknyszekgopherbot
authored andcommitted
runtime: move goroutine stack exists events after span events
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 <[email protected]> Auto-Submit: Michael Knyszek <[email protected]> Reviewed-by: Michael Pratt <[email protected]>
1 parent 1110c40 commit b6fa505

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/runtime/traceallocfree.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ func traceSnapshotMemory(gen uintptr) {
4949
throw("traceSnapshotMemory: tracing is not enabled")
5050
}
5151

52-
// Write out all the goroutine stacks.
53-
forEachGRace(func(gp *g) {
54-
trace.GoroutineStackExists(gp.stack.lo, gp.stack.hi-gp.stack.lo)
55-
})
56-
5752
// Write out all the heap spans and heap objects.
5853
for _, s := range mheap_.allspans {
5954
if s.state.get() == mSpanDead {
@@ -77,6 +72,11 @@ func traceSnapshotMemory(gen uintptr) {
7772
abits.advance()
7873
}
7974
}
75+
76+
// Write out all the goroutine stacks.
77+
forEachGRace(func(gp *g) {
78+
trace.GoroutineStackExists(gp.stack.lo, gp.stack.hi-gp.stack.lo)
79+
})
8080
traceRelease(trace)
8181
}
8282

0 commit comments

Comments
 (0)