runtime/pprof: make TestBlockProfile more robust
It's using debug mode of pprof.writeBlock, so the output actually goes through text/tabwriter. It is possible that tabwriter expands each tab into multiple tabs in certain cases. For example, this output has been observed on the new arm64 port: 10073805 1 @ 0x1088ec 0xd1b8c 0xd0628 0xb68c0 0x867f4 # 0x1088ec sync.(*Cond).Wait+0xfc /home/minux/go.git/src/sync/cond.go:63 # 0xd1b8c runtime/pprof_test.blockCond+0x22c /home/minux/go.git/src/runtime/pprof/pprof_test.go:454 # 0xd0628 runtime/pprof_test.TestBlockProfile+0x1b8 /home/minux/go.git/src/runtime/pprof/pprof_test.go:359 # 0xb68c0 testing.tRunner+0x140 /home/minux/go.git/src/testing/testing.go:447 10069965 1 @ 0x14008 0xd1390 0xd0628 0xb68c0 0x867f4 # 0x14008 runtime.chansend1+0x48 /home/minux/go.git/src/runtime/chan.go:76 # 0xd1390 runtime/pprof_test.blockChanSend+0x100 /home/minux/go.git/src/runtime/pprof/pprof_test.go:396 # 0xd0628 runtime/pprof_test.TestBlockProfile+0x1b8 /home/minux/go.git/src/runtime/pprof/pprof_test.go:359 # 0xb68c0 testing.tRunner+0x140 /home/minux/go.git/src/testing/testing.go:447 10069706 1 @ 0x108e0c 0xd193c 0xd0628 0xb68c0 0x867f4 # 0x108e0c sync.(*Mutex).Lock+0x19c /home/minux/go.git/src/sync/mutex.go:67 # 0xd193c runtime/pprof_test.blockMutex+0xbc /home/minux/go.git/src/runtime/pprof/pprof_test.go:441 # 0xd0628 runtime/pprof_test.TestBlockProfile+0x1b8 /home/minux/go.git/src/runtime/pprof/pprof_test.go:359 # 0xb68c0 testing.tRunner+0x140 /home/minux/go.git/src/testing/testing.go:447 Change-Id: I3bef778c5fe01a894cfdc526fdc5fecb873b8ade Signed-off-by: Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/5554Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Showing
Please
register
or
sign in
to comment