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
This commit is contained in:
Ian Lance Taylor 2019-01-18 03:29:38 +00:00
parent 151a199f29
commit aee6ed4a2c
2 changed files with 10 additions and 3 deletions

View File

@ -1,4 +1,4 @@
d6576c83016d856217758c06d945bfc363ffb817
d16e9181a760796802c067730bb030b92b63fb2c
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.

View File

@ -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