aboutsummaryrefslogtreecommitdiff
path: root/src/internal/trace/parser_test.go
diff options
context:
space:
mode:
authorHana Kim <hakim@google.com>2017-12-12 18:20:06 -0500
committerHyang-Ah Hana Kim <hyangah@gmail.com>2017-12-20 23:04:21 +0000
commita58286c289c227fe09cb71d57483d4fd8eeff0bd (patch)
tree9ee5b5459f90bedf4ae9290432279111d915c003 /src/internal/trace/parser_test.go
parent841d865a56dee8dc4c712eea8eacc3a3d5256c6e (diff)
downloadgo-a58286c289c227fe09cb71d57483d4fd8eeff0bd.tar.xz
cmd/trace: init goroutine info entries with GoCreate event
golang.org/cl/81315 attempted to distinguish system goroutines by examining the function name in the goroutine stack. It assumes that the information would be available when GoSysBlock or GoInSyscall events are processed, but it turned out the stack information is set too late (when the goroutine gets a chance to run). This change initializes the goroutine information entry when processing GoCreate event which should be one of the very first events for the every goroutine in trace. Fixes #22574 Change-Id: I1ed37087ce2e78ed27c9b419b7d942eb4140cc69 Reviewed-on: https://go-review.googlesource.com/83595 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/internal/trace/parser_test.go')
-rw-r--r--src/internal/trace/parser_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/internal/trace/parser_test.go b/src/internal/trace/parser_test.go
index d6f580aed5..c9afa68c3c 100644
--- a/src/internal/trace/parser_test.go
+++ b/src/internal/trace/parser_test.go
@@ -25,8 +25,8 @@ func TestCorruptedInputs(t *testing.T) {
"go 1.5 trace\x00\x00\x00\x00\xc3\x0200",
}
for _, data := range tests {
- events, err := Parse(strings.NewReader(data), "")
- if err == nil || events != nil {
+ res, err := Parse(strings.NewReader(data), "")
+ if err == nil || res.Events != nil || res.Stacks != nil {
t.Fatalf("no error on input: %q", data)
}
}