From 6e2ae0a12c0f73da56d4f465e68208731b4b16be Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 28 Feb 2012 16:18:24 -0500 Subject: runtime/pprof: support OS X CPU profiling Work around profiling kernel bug with signal masks. Still broken on 64-bit Snow Leopard kernel, but I think we can ignore that one and let people upgrade to Lion. Add new trivial tools addr2line and objdump to take the place of the GNU tools of the same name, since those are not installed on OS X. Adapt pprof to invoke 'go tool addr2line' and 'go tool objdump' if the system tools do not exist. Clean up disassembly of base register on amd64. Fixes #2008. R=golang-dev, bradfitz, mikioh.mikioh, r, iant CC=golang-dev https://golang.org/cl/5697066 --- src/pkg/runtime/thread_linux.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/pkg/runtime/thread_linux.c') diff --git a/src/pkg/runtime/thread_linux.c b/src/pkg/runtime/thread_linux.c index d406a71240..6b428440e0 100644 --- a/src/pkg/runtime/thread_linux.c +++ b/src/pkg/runtime/thread_linux.c @@ -228,7 +228,7 @@ runtime·memlimit(void) Rlimit rl; extern byte text[], end[]; uintptr used; - + if(runtime·getrlimit(RLIMIT_AS, &rl) != 0) return 0; if(rl.rlim_cur >= 0x7fffffff) @@ -249,3 +249,9 @@ runtime·memlimit(void) return rl.rlim_cur - used; } + +void +runtime·setprof(bool on) +{ + USED(on); +} -- cgit v1.3