runtime: rename getcallerfp to getfp

The previous name was wrong due to the mistaken assumption that calling
f->g->getcallerpc and f->g->getcallersp would respectively return the
pc/sp at g. However, they are actually referring to their caller's
caller, i.e. f.

Rename getcallerfp to getfp in order to stay consistent with this
naming convention.

Also see discussion on CL 463835.

For #16638

This is a redo of CL 481617 that became necessary because CL 461738
added another call site for getcallerfp().

Change-Id: If0b536e85a6c26061b65e7b5c2859fc31385d025
Reviewed-on: https://go-review.googlesource.com/c/go/+/494857
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Felix Geisendörfer <felix.geisendoerfer@datadoghq.com>
This commit is contained in:
Felix Geisendörfer 2023-04-04 01:10:55 +02:00 committed by Quim Muntal
parent d75cc4b9c6
commit 3afbca5c5f
16 changed files with 36 additions and 27 deletions

View file

@ -1826,7 +1826,7 @@ func PersistentAlloc(n uintptr) unsafe.Pointer {
// FPCallers works like Callers and uses frame pointer unwinding to populate
// pcBuf with the return addresses of the physical frames on the stack.
func FPCallers(pcBuf []uintptr) int {
return fpTracebackPCs(unsafe.Pointer(getcallerfp()), pcBuf)
return fpTracebackPCs(unsafe.Pointer(getfp()), pcBuf)
}
var (