summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/symtab.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-03-24 09:40:09 -0700
committerRuss Cox <rsc@golang.org>2010-03-24 09:40:09 -0700
commit555f59fbaa0b3cb086c62be60f5f460205a63167 (patch)
tree881a840ee1f85e3047ae2629fbe9db5f448d3411 /src/pkg/runtime/symtab.c
parentc4c6e15a37fb226ff214ad727b64097832a7d2c9 (diff)
downloadgo-555f59fbaa0b3cb086c62be60f5f460205a63167.tar.gz
runtime: malloc sampling, pprof interface
R=r CC=golang-dev http://codereview.appspot.com/719041
Diffstat (limited to 'src/pkg/runtime/symtab.c')
-rw-r--r--src/pkg/runtime/symtab.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pkg/runtime/symtab.c b/src/pkg/runtime/symtab.c
index 51d572595..9e69ab4bf 100644
--- a/src/pkg/runtime/symtab.c
+++ b/src/pkg/runtime/symtab.c
@@ -299,6 +299,7 @@ splitpcln(void)
// Return actual file line number for targetpc in func f.
// (Source file is f->src.)
+// NOTE(rsc): If you edit this function, also edit extern.go:/FileLine
int32
funcline(Func *f, uint64 targetpc)
{
@@ -333,6 +334,12 @@ buildfuncs(void)
if(func != nil)
return;
+
+ // Memory profiling uses this code;
+ // can deadlock if the profiler ends
+ // up back here.
+ m->nomemprof++;
+
// count funcs, fnames
nfunc = 0;
nfname = 0;
@@ -350,6 +357,8 @@ buildfuncs(void)
// record src file and line info for each func
walksymtab(dosrcline);
+
+ m->nomemprof--;
}
Func*