libgo: delay applying profile stack-frame skip until fixup
authorIan Lance Taylor <ian@gcc.gnu.org>
Mon, 3 Jun 2019 23:07:54 +0000 (23:07 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 3 Jun 2019 23:07:54 +0000 (23:07 +0000)
commitc533ffe04d5fc1baa85dddd8fd5f651128cf11ed
tree9b0df7f8a2130484fd7458745c8ec0361f3f9850
parent3e6f8fe1bc4c60859113bca7970b0b8db56eb442
libgo: delay applying profile stack-frame skip until fixup

    When the runtime collects a stack trace to associate it with some
    profiling event (mem alloc, mutex, etc) there is a skip count passed
    to runtime.Callers (or equivalent) to skip some known count of frames
    in order to get to the "interesting" frame corresponding to the
    profile event. Now that the profiling mechanism uses lazy fixup (when
    removing compiler artifacts like thunks, morestack calls etc), we also
    need to move the frame skipping logic after the fixup, so as to insure
    that the skip count isn't thrown off by these artifacts.

    Fixes golang/go#32290.

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/179740

From-SVN: r271892
gcc/go/gofrontend/MERGE
libgo/go/runtime/mprof.go
libgo/go/runtime/traceback_gccgo.go
libgo/runtime/go-callers.c