go/src/internal/trace
Hyang-Ah (Hana) Kim c24cc40075 cmd/trace: fix a runnable goroutine count bug
When starting tracing, EvGoCreate events are added for existing
goroutines that may have been blocking in syscall. EvGoCreate
increments the runnable goroutine count. This change makes the
following EvGoInSyscall event decrement the runnable goroutine count
because we now know that goroutine is in syscall, and not runnable.

Made generateTrace return an error, at any given time, the number
of runnable/running/insyscall goroutines becomes non-negative.

Added a basic test that checks the number of runnable/running
goroutines don't include the goroutines in syscall - the test failed
before this change.

Change-Id: Ib732c382e7bd17158a437576f9d589ab89097ce6
Reviewed-on: https://go-review.googlesource.com/25552
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2016-10-11 12:07:44 +00:00
..
testdata internal/trace: support parsing of 1.5 traces 2016-04-11 17:56:44 +00:00
goroutines.go cmd/trace: move goroutine analysis code to internal/trace 2015-03-11 12:53:24 +00:00
order.go internal/trace: fix event ordering for coarse timestamps 2016-04-24 16:50:25 +00:00
parser.go cmd/trace: label mark termination spans as such 2016-10-07 18:33:23 +00:00
parser_test.go cmd/trace: fix a runnable goroutine count bug 2016-10-11 12:07:44 +00:00
writer.go cmd/trace: fix a runnable goroutine count bug 2016-10-11 12:07:44 +00:00