aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/heapdump.go
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-05-14 14:59:42 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-05-14 14:59:42 +0000
commit1ac09ef2c611d3113665ec8c74e38b125217edb3 (patch)
tree0bed1e11d205c99ef1f13dd4b7aece761779c360 /libgo/go/runtime/heapdump.go
parentce9f305e44ff0353ee9e6cb07599240354ae9ed2 (diff)
downloadgcc-1ac09ef2c611d3113665ec8c74e38b125217edb3.zip
gcc-1ac09ef2c611d3113665ec8c74e38b125217edb3.tar.gz
gcc-1ac09ef2c611d3113665ec8c74e38b125217edb3.tar.bz2
libgo: reduce overhead for memory/block/mutex profiling
Revise the gccgo version of memory/block/mutex profiling to reduce runtime overhead. The main change is to collect raw stack traces while the profile is on line, then post-process the stacks just prior to the point where we are ready to use the final product. Memory profiling (at a very low sampling rate) is enabled by default, and the overhead of the symbolization / DWARF-reading from backtrace_full was slowing things down relative to the main Go runtime. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/171497 From-SVN: r271172
Diffstat (limited to 'libgo/go/runtime/heapdump.go')
-rw-r--r--libgo/go/runtime/heapdump.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/libgo/go/runtime/heapdump.go b/libgo/go/runtime/heapdump.go
index 3aa9e8a..b0506a8 100644
--- a/libgo/go/runtime/heapdump.go
+++ b/libgo/go/runtime/heapdump.go
@@ -437,17 +437,15 @@ func dumpmemstats() {
dumpint(uint64(memstats.numgc))
}
-func dumpmemprof_callback(b *bucket, nstk uintptr, pstk *location, size, allocs, frees uintptr) {
- stk := (*[100000]location)(unsafe.Pointer(pstk))
+func dumpmemprof_callback(b *bucket, nstk uintptr, pstk *uintptr, size, allocs, frees uintptr) {
+ stk := (*[100000]uintptr)(unsafe.Pointer(pstk))
dumpint(tagMemProf)
dumpint(uint64(uintptr(unsafe.Pointer(b))))
dumpint(uint64(size))
dumpint(uint64(nstk))
for i := uintptr(0); i < nstk; i++ {
- pc := stk[i].pc
- fn := stk[i].function
- file := stk[i].filename
- line := stk[i].lineno
+ pc := stk[i]
+ fn, file, line, _ := funcfileline(pc, -1)
if fn == "" {
var buf [64]byte
n := len(buf)