diff options
Diffstat (limited to 'src/pkg/runtime/cpuprof.c')
-rw-r--r-- | src/pkg/runtime/cpuprof.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/pkg/runtime/cpuprof.c b/src/pkg/runtime/cpuprof.c index 9a0606a22..1c34b9e6f 100644 --- a/src/pkg/runtime/cpuprof.c +++ b/src/pkg/runtime/cpuprof.c @@ -127,10 +127,6 @@ runtime·SetCPUProfileRate(intgo hz) { uintptr *p; uintptr n; - - // Call findfunc now so that it won't have to - // build tables during the signal handler. - runtime·findfunc(0); // Clamp hz to something reasonable. if(hz < 0) @@ -141,7 +137,7 @@ runtime·SetCPUProfileRate(intgo hz) runtime·lock(&lk); if(hz > 0) { if(prof == nil) { - prof = runtime·SysAlloc(sizeof *prof); + prof = runtime·SysAlloc(sizeof *prof, &mstats.other_sys); if(prof == nil) { runtime·printf("runtime: cpu profiling cannot allocate memory\n"); runtime·unlock(&lk); @@ -335,7 +331,7 @@ getprofile(Profile *p) if(p->wholding) { // Release previous log to signal handling side. - // Loop because we are racing against setprofile(off). + // Loop because we are racing against SetCPUProfileRate(0). for(;;) { n = p->handoff; if(n == 0) { @@ -362,9 +358,7 @@ getprofile(Profile *p) return ret; // Wait for new log. - runtime·entersyscallblock(); - runtime·notesleep(&p->wait); - runtime·exitsyscall(); + runtime·notetsleepg(&p->wait, -1); runtime·noteclear(&p->wait); n = p->handoff; |