2011-04-03 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR go/48222
* runtime/malloc.goc (runtime_mallocinit): Call
runtime_Mprof_Init, runtime_initfintab.
* runtime/cpuprof.c (runtime_cpuprofinit): New function.
* runtime/runtime.h (runtime_cpuprofinit): Declare it.
* runtime/go-main.c (main): Use it.
From-SVN: r171960
static bool evict(Profile*, Entry*);
static bool flushlog(Profile*);
+void
+runtime_cpuprofinit(void)
+{
+ runtime_initlock(&lk);
+}
+
// LostProfileData is a no-op function used in profiles
// to mark the number of profiling stack traces that were
// discarded due to slow data writers.
struct __go_string *values;
runtime_mallocinit ();
+ runtime_cpuprofinit ();
__go_gc_goroutine_init (&argc);
Args.__count = argc;
runtime_MHeap_Init(&runtime_mheap, runtime_SysAlloc);
m->mcache = runtime_allocmcache();
+ // Initialize malloc profiling.
+ runtime_Mprof_Init();
+
+ // Initialize finalizer.
+ runtime_initfintab();
+
// See if it works.
runtime_free(runtime_malloc(1));
}
#define runtime_casp(pval, old, new) __sync_bool_compare_and_swap (pval, old, new)
void runtime_sigprof(uint8 *pc, uint8 *sp, uint8 *lr);
+void runtime_cpuprofinit(void);
void runtime_resetcpuprofiler(int32);
void runtime_setcpuprofilerate(void(*)(uintptr*, int32), int32);