Skip to content

Commit c3db9af

Browse files
felixgeprattmic
authored andcommitted
runtime: remove unused skip arg from fpTracebackPCs
This was accidentally left behind when moving the logic to set the skip sentinel in pcBuf to the caller. Change-Id: Id7565f6ea4df6b32cf18b99c700bca322998d182 Reviewed-on: https://go-review.googlesource.com/c/go/+/489095 Reviewed-by: Michael Pratt <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Felix Geisendörfer <[email protected]>
1 parent 6d2309b commit c3db9af

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/runtime/callers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ func fpCallersCached(b *testing.B, n int) int {
443443
pcs := make([]uintptr, 32)
444444
b.ResetTimer()
445445
for i := 0; i < b.N; i++ {
446-
runtime.FPCallers(0, pcs)
446+
runtime.FPCallers(pcs)
447447
}
448448
b.StopTimer()
449449
return 0

src/runtime/export_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ func ShrinkStackAndVerifyFramePointers() {
437437
})
438438
// If our new stack contains frame pointers into the old stack, this will
439439
// crash because the old stack has been poisoned.
440-
FPCallers(0, make([]uintptr, 1024))
440+
FPCallers(make([]uintptr, 1024))
441441
}
442442

443443
// BlockOnSystemStack switches to the system stack, prints "x\n" to
@@ -1819,6 +1819,6 @@ func PersistentAlloc(n uintptr) unsafe.Pointer {
18191819

18201820
// FPCallers works like Callers and uses frame pointer unwinding to populate
18211821
// pcBuf with the return addresses of the physical frames on the stack.
1822-
func FPCallers(skip int, pcBuf []uintptr) int {
1823-
return fpTracebackPCs(unsafe.Pointer(getcallerfp()), skip, pcBuf)
1822+
func FPCallers(pcBuf []uintptr) int {
1823+
return fpTracebackPCs(unsafe.Pointer(getcallerfp()), pcBuf)
18241824
}

src/runtime/trace.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -917,15 +917,15 @@ func traceStackID(mp *m, pcBuf []uintptr, skip int) uint64 {
917917
// Fast path: Unwind using frame pointers.
918918
pcBuf[0] = uintptr(skip)
919919
if curgp == gp {
920-
nstk += fpTracebackPCs(unsafe.Pointer(getcallerfp()), skip, pcBuf[1:])
920+
nstk += fpTracebackPCs(unsafe.Pointer(getcallerfp()), pcBuf[1:])
921921
} else if curgp != nil {
922922
// We're called on the g0 stack through mcall(fn) or systemstack(fn). To
923923
// behave like gcallers above, we start unwinding from sched.bp, which
924924
// points to the caller frame of the leaf frame on g's stack. The return
925925
// address of the leaf frame is stored in sched.pc, which we manually
926926
// capture here.
927927
pcBuf[1] = curgp.sched.pc
928-
nstk += 1 + fpTracebackPCs(unsafe.Pointer(curgp.sched.bp), skip, pcBuf[2:])
928+
nstk += 1 + fpTracebackPCs(unsafe.Pointer(curgp.sched.bp), pcBuf[2:])
929929
}
930930
}
931931
if nstk > 0 {
@@ -948,7 +948,7 @@ func tracefpunwindoff() bool {
948948
// returns the number of PCs written to pcBuf. The returned PCs correspond to
949949
// "physical frames" rather than "logical frames"; that is if A is inlined into
950950
// B, this will return a PC for only B.
951-
func fpTracebackPCs(fp unsafe.Pointer, skip int, pcBuf []uintptr) (i int) {
951+
func fpTracebackPCs(fp unsafe.Pointer, pcBuf []uintptr) (i int) {
952952
for i = 0; i < len(pcBuf) && fp != nil; i++ {
953953
// return addr sits one word above the frame pointer
954954
pcBuf[i] = *(*uintptr)(unsafe.Pointer(uintptr(fp) + goarch.PtrSize))

0 commit comments

Comments
 (0)