]> Cypherpunks repositories - gostls13.git/commit
runtime: make systemstack tail call if already switched
authorAustin Clements <austin@google.com>
Fri, 27 Oct 2017 19:20:21 +0000 (15:20 -0400)
committerAustin Clements <austin@google.com>
Mon, 30 Oct 2017 16:33:55 +0000 (16:33 +0000)
commit15d6ab69fbd8c84cde109def59c7e002296c19e8
tree4e41f0e94965a21024d4c3bd13011edfea04922c
parent67a7d5d88503646a7e411cf5ae9c38e485b9be1b
runtime: make systemstack tail call if already switched

Currently systemstack always calls its argument, even if we're already
on the system stack. Unfortunately, traceback with _TraceJump stops at
the first systemstack it sees, which often cuts off runtime stacks
early in profiles.

Fix this by performing a tail call if we're already on the system
stack. This eliminates it from the traceback entirely, so it won't
stop prematurely (or all get mushed into a single node in the profile
graph).

Change-Id: Ibc69e8765e899f8d3806078517b8c7314da196f4
Reviewed-on: https://go-review.googlesource.com/74050
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/asm_386.s
src/runtime/asm_amd64.s
src/runtime/asm_amd64p32.s
src/runtime/asm_arm.s
src/runtime/asm_arm64.s
src/runtime/asm_mips64x.s
src/runtime/asm_mipsx.s
src/runtime/asm_ppc64x.s
src/runtime/asm_s390x.s
src/runtime/export_test.go
src/runtime/stack_test.go