]> Cypherpunks repositories - gostls13.git/commit
cmd/trace: don't drop sweep slice details
authorHana Kim <hyangah@gmail.com>
Mon, 17 Sep 2018 18:46:50 +0000 (14:46 -0400)
committerHyang-Ah Hana Kim <hyangah@gmail.com>
Mon, 17 Sep 2018 19:38:10 +0000 (19:38 +0000)
commite57f24ab39ff6e0ea50c84518e7f91b3a40cf547
tree5e7fbfc525434700ef9f9e64723bc7b87385c378
parent8595868ea781a19b765319ce42da5c074c73ae34
cmd/trace: don't drop sweep slice details

For sweep events, we used to modify the ViewerEvent returned from
ctx.emitSlice later in order to embed more details about the sweep
operation. The trick no longer works after the change
https://golang.org/cl/92375 and caused a regression.

ctx.emit method encodes the ViewerEvent, so any modification to the
ViewerEvent object after ctx.emit returns will not be reflected.

Refactor ctx.emitSlice, so ctx.makeSlice can be used when producing
slices for SWEEP. ctx.emit* methods are meant to truely emit
ViewerEvents.

Fixes #27711

Change-Id: I0b733ebbbfd4facd8714db0535809ec3cab0833d
Reviewed-on: https://go-review.googlesource.com/135775
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/trace/trace.go