]> Cypherpunks repositories - gostls13.git/commit
cmd/trace: only include required frames in splits
authorMichael Pratt <mpratt@google.com>
Wed, 26 Oct 2022 22:12:21 +0000 (18:12 -0400)
committerGopher Robot <gobot@golang.org>
Mon, 7 Nov 2022 17:58:30 +0000 (17:58 +0000)
commitd2b5a6f332b011c75c17bfb99216cc51ac7a0b5f
tree8008c30db4571ee90d58b378a329b168cacb21ae
parent50664c236f9ab38cd57e0a36cf29527d4c513010
cmd/trace: only include required frames in splits

Though we split traces into 100MB chunks, currently each chunk always
includes the entire stack frame map, including frames for all events in
the trace file, even if they aren't needed by events in this chunk.

This means that if the stack frame JSON alone is >100MB then there is no
space at all for events. In that case, we'll generate splits each
containing 1 event, which is effectively useless.

Handle this more efficiently by only including stack frames referenced
by events in the chunk. Each marginal events only adds at most a few
dozen stack frames, so it should now longer be possible to only include
a tiny number of events.

Fixes #56444.

Change-Id: I58aa8f271c32678028b72d82df16e6ea762ebb39
Reviewed-on: https://go-review.googlesource.com/c/go/+/445895
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/trace/trace.go