diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2013-01-30 22:24:40 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2013-01-30 22:24:40 +0000 |
commit | 27741f93ef6db21d70fd0a0fe33a68a82b4e79fd (patch) | |
tree | 1764d8d318ba67622aefbf3e311749a6744bfa02 /libgo/runtime/proc.c | |
parent | e60e09a0e0e8c1b17fc35cf25b739666a96010b9 (diff) | |
download | gcc-27741f93ef6db21d70fd0a0fe33a68a82b4e79fd.zip gcc-27741f93ef6db21d70fd0a0fe33a68a82b4e79fd.tar.gz gcc-27741f93ef6db21d70fd0a0fe33a68a82b4e79fd.tar.bz2 |
runtime: In backtraces, get inline functions, skip split-stack fns.
From-SVN: r195591
Diffstat (limited to 'libgo/runtime/proc.c')
-rw-r--r-- | libgo/runtime/proc.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libgo/runtime/proc.c b/libgo/runtime/proc.c index b2e37f3..6d90076 100644 --- a/libgo/runtime/proc.c +++ b/libgo/runtime/proc.c @@ -631,7 +631,7 @@ runtime_goroutinetrailer(G *g) struct Traceback { G* gp; - uintptr pcbuf[100]; + Location locbuf[100]; int32 c; }; @@ -677,7 +677,7 @@ runtime_tracebackothers(G * volatile me) runtime_gogo(gp); } - runtime_printtrace(tb.pcbuf, tb.c, false); + runtime_printtrace(tb.locbuf, tb.c, false); runtime_goroutinetrailer(gp); } } @@ -692,8 +692,8 @@ gtraceback(G* gp) traceback = gp->traceback; gp->traceback = nil; - traceback->c = runtime_callers(1, traceback->pcbuf, - sizeof traceback->pcbuf / sizeof traceback->pcbuf[0]); + traceback->c = runtime_callers(1, traceback->locbuf, + sizeof traceback->locbuf / sizeof traceback->locbuf[0]); runtime_gogo(traceback->gp); } @@ -1742,13 +1742,14 @@ static struct { void (*fn)(uintptr*, int32); int32 hz; uintptr pcbuf[100]; + Location locbuf[100]; } prof; // Called if we receive a SIGPROF signal. void runtime_sigprof() { - int32 n; + int32 n, i; if(prof.fn == nil || prof.hz == 0) return; @@ -1758,7 +1759,9 @@ runtime_sigprof() runtime_unlock(&prof); return; } - n = runtime_callers(0, prof.pcbuf, nelem(prof.pcbuf)); + n = runtime_callers(0, prof.locbuf, nelem(prof.locbuf)); + for(i = 0; i < n; i++) + prof.pcbuf[i] = prof.locbuf[i].pc; if(n > 0) prof.fn(prof.pcbuf, n); runtime_unlock(&prof); |