aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mprof.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2023-02-14 12:25:11 -0500
committerAustin Clements <austin@google.com>2023-03-10 17:59:37 +0000
commit3e360b035f4c3014e9564f4994c68ccc296ef629 (patch)
tree1eddb9edefe065d015026fe628b8b62e7f7e3320 /src/runtime/mprof.go
parent9872428a715a907a122ad705b5fa42f11a385664 (diff)
downloadgo-3e360b035f4c3014e9564f4994c68ccc296ef629.tar.xz
runtime: new API for filling PC traceback buffers
Currently, filling PC traceback buffers is one of the jobs of gentraceback. This moves it into a new function, tracebackPCs, with a simple API built around unwinder, and changes all callers to use this new API. Updates #54466. Change-Id: Id2038bded81bf533a5a4e71178a7c014904d938c Reviewed-on: https://go-review.googlesource.com/c/go/+/468300 Reviewed-by: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/mprof.go')
-rw-r--r--src/runtime/mprof.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/runtime/mprof.go b/src/runtime/mprof.go
index cf9e032981..dfaa369740 100644
--- a/src/runtime/mprof.go
+++ b/src/runtime/mprof.go
@@ -1173,7 +1173,9 @@ func GoroutineProfile(p []StackRecord) (n int, ok bool) {
}
func saveg(pc, sp uintptr, gp *g, r *StackRecord) {
- n := gentraceback(pc, sp, 0, gp, 0, &r.Stack0[0], len(r.Stack0), nil, nil, 0)
+ var u unwinder
+ u.initAt(pc, sp, 0, gp, unwindSilentErrors)
+ n := tracebackPCs(&u, 0, r.Stack0[:])
if n < len(r.Stack0) {
r.Stack0[n] = 0
}