]> Cypherpunks repositories - gostls13.git/commit
runtime: deflake TestCgoPprofThread
authorCherry Mui <cherryyz@google.com>
Tue, 17 May 2022 21:52:43 +0000 (17:52 -0400)
committerCherry Mui <cherryyz@google.com>
Tue, 17 May 2022 22:59:31 +0000 (22:59 +0000)
commitc6965ad63fc66e02f37c9dcfc381c898983cec16
treed72e23a131f534ed49070dfcc541c32b6843f07a
parent3483ce0a28ebfe287416889e87a51dd3636223aa
runtime: deflake TestCgoPprofThread

In TestCgoPprofThread, the (fake) cgo traceback function pretends
all C CPU samples are in cpuHogThread. But if a profiling signal
lands in C code but outside of that thread, e.g. before/when the
thread is created, we will get a sample which looks like Go calls
into cpuHogThread. This CL makes the cgo traceback function only
return cpuHogThread PCs when a signal lands on that thread.

May fix #52726.

Change-Id: I21c40f974d1882508626faf3ac45e8347fec31c4
Reviewed-on: https://go-review.googlesource.com/c/go/+/406934
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/runtime/testdata/testprogcgo/threadpprof.go