]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: use FuncInfo SPWRITE flag to identify untraceable profile samples
authorRuss Cox <rsc@golang.org>
Thu, 28 Jan 2021 21:10:58 +0000 (16:10 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 19 Feb 2021 00:02:40 +0000 (00:02 +0000)
commitfbe74dbf4263841819368a2a3c90e599392e0808
tree488b8dc4438c18c4095af3a8f5dcd8137e9b3ac1
parent4dd77bdc910494adcd57fe9d87cd46f72d8d8985
runtime: use FuncInfo SPWRITE flag to identify untraceable profile samples

The old code was very clever about predicting whether a traceback was safe.
That cleverness has not aged well. In particular, the setsSP function is missing
a bunch of functions that write to SP and will confuse traceback.
And one such function - jmpdefer - was handled as a special case in
gentraceback instead of simply listing it in setsSP.

Throw away all the clever prediction about whether traceback will crash.
Instead, make traceback NOT crash, by checking whether the function
being walked writes to SP.

This CL is part of a stack adding windows/arm64
support (#36439), intended to land in the Go 1.17 cycle.
This CL is, however, not windows/arm64-specific.
It is cleanup meant to make the port (and future ports) easier.

Change-Id: I3d55fe257a22745e4919ac4dc9a9378c984ba0da
Reviewed-on: https://go-review.googlesource.com/c/go/+/288801
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/runtime/asm_arm.s
src/runtime/pprof/pprof_test.go
src/runtime/proc.go
src/runtime/traceback.go