go/src/internal/trace
doujiang24 fb6c210dc3 runtime/trace: add missing events for the locked g in extra M.
Extra Ms may lead to the "no consistent ordering of events possible" error when parsing trace file with cgo enabled, since:
1. The gs in the extra Ms may be in `_Gdead` status while starting trace by invoking `runtime.StartTrace`,
2. and these gs will trigger `traceEvGoSysExit` events in `runtime.exitsyscall` when invoking go functions from c,
3. then, the events of those gs are under non-consistent ordering, due to missing the previous events.

Add two events, `traceEvGoCreate` and `traceEvGoInSyscall`, in `runtime.StartTrace`, will make the trace parser happy.

Fixes #29707

Change-Id: I2fd9d1713cda22f0ddb36efe1ab351f88da10881
GitHub-Last-Rev: 7bbfddb81b
GitHub-Pull-Request: golang/go#54974
Reviewed-on: https://go-review.googlesource.com/c/go/+/429858
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: xie cui <523516579@qq.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Michael Pratt <mpratt@google.com>
2022-09-27 16:37:51 +00:00
..
testdata internal/trace: add Go 1.19 test data 2022-06-24 22:08:17 +00:00
gc.go all: gofmt -w -r 'interface{} -> any' src 2021-12-13 18:45:54 +00:00
gc_test.go all: update to use os.ReadFile, os.WriteFile, os.CreateTemp, os.MkdirTemp 2020-12-09 19:12:23 +00:00
goroutines.go runtime/trace: add missing events for the locked g in extra M. 2022-09-27 16:37:51 +00:00
mkcanned.bash internal/trace: add Go 1.19 test data 2022-06-24 22:08:17 +00:00
mud.go cmd/trace: revert internal/traceparser 2018-11-22 02:59:55 +00:00
mud_test.go cmd/trace: revert internal/traceparser 2018-11-22 02:59:55 +00:00
order.go runtime: add CPU samples to execution trace 2022-05-03 20:49:46 +00:00
parser.go internal/trace: use strings.Builder 2022-09-06 12:35:13 +00:00
parser_test.go all: update to use os.ReadDir where appropriate 2020-12-09 19:12:27 +00:00
writer.go internal/trace: add license header to writer.go 2020-05-10 10:22:35 +00:00