The runtime/pprof package builds stack traces that skip runtime
functions. When libgo is compiled with -O0, the function profilealloc
appears on the stack trace, but the package doesn't know to skip it.
Rename the function so that it is skipped. This lets the
runtime/pprof test pass when libgo is compiled with -O0. Bootstrapped
and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to
mainline.
Ian
diff -r 98c204d2dfae libgo/runtime/malloc.goc
--- a/libgo/runtime/malloc.goc Wed May 06 15:59:21 2015 -0700
+++ b/libgo/runtime/malloc.goc Mon May 11 09:03:05 2015 -0700
@@ -64,7 +64,7 @@
__asm__ (GOSYM_PREFIX "runtime.MemProfileRate");
static MSpan* largealloc(uint32, uintptr*);
-static void profilealloc(void *v, uintptr size);
+static void runtime_profilealloc(void *v, uintptr size);
static void settype(MSpan *s, void *v, uintptr typ);
// Allocate an object of at least size bytes.
@@ -250,7 +250,7 @@
if(size < (uintptr)rate && size <
(uintptr)(uint32)c->next_sample)
c->next_sample -= size;
else
- profilealloc(v, size);
+ runtime_profilealloc(v, size);
}
m->locks--;
@@ -290,7 +290,7 @@
}
static void
-profilealloc(void *v, uintptr size)
+runtime_profilealloc(void *v, uintptr size)
{
uintptr rate;
int32 next;