aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-01-18 03:29:38 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-01-18 03:29:38 +0000
commitaee6ed4a2cbed1ac8be35332ee2391206e2101a2 (patch)
treee50bdbe4203778fb88f8247d303ef2c3bcb04c3d /libgo
parent151a199f292c8978bf3d5d2123e65af224ed45c2 (diff)
downloadgcc-aee6ed4a2cbed1ac8be35332ee2391206e2101a2.zip
gcc-aee6ed4a2cbed1ac8be35332ee2391206e2101a2.tar.gz
gcc-aee6ed4a2cbed1ac8be35332ee2391206e2101a2.tar.bz2
re PR go/88202 (FAIL: runtime/pprof)
PR go/88202 runtime: in sigprof, skip to sigtrampgo if we don't find sigtramp Fixes https://gcc.gnu.org/PR88202 Reviewed-on: https://go-review.googlesource.com/c/158218 From-SVN: r268057
Diffstat (limited to 'libgo')
-rw-r--r--libgo/go/runtime/proc.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/libgo/go/runtime/proc.go b/libgo/go/runtime/proc.go
index 655d0a9..80b04ab 100644
--- a/libgo/go/runtime/proc.go
+++ b/libgo/go/runtime/proc.go
@@ -3600,10 +3600,17 @@ func sigprof(pc uintptr, gp *g, mp *m) {
// To ensure a sane profile, walk through the frames in
// "stklocs" until we find the "runtime.sigtramp" frame, then
// report only those frames below the frame one down from
- // that. If for some reason "runtime.sigtramp" is not present,
- // don't make any changes.
+ // that. On systems that don't split stack, "sigtramp" can
+ // do a sibling call to "sigtrampgo", so use "sigtrampgo"
+ // if we don't find "sigtramp". If for some reason
+ // neither "runtime.sigtramp" nor "runtime.sigtrampgo" is
+ // present, don't make any changes.
framesToDiscard := 0
for i := 0; i < n; i++ {
+ if stklocs[i].function == "runtime.sigtrampgo" && i+2 < n {
+ framesToDiscard = i + 2
+ n -= framesToDiscard
+ }
if stklocs[i].function == "runtime.sigtramp" && i+2 < n {
framesToDiscard = i + 2
n -= framesToDiscard