Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Issue 5697066: code review 5697066: runtime/pprof: support OS X CPU profiling (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by rsc
Modified:
12 years, 1 month ago
Reviewers:
CC:
golang-dev, bradfitz, mikio, r, iant
Visibility:
Public.

Description

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 issue 2008.

Patch Set 1 #

Patch Set 2 : diff -r 84582b0431a1 https://code.google.com/p/go/ #

Patch Set 3 : diff -r 84582b0431a1 https://code.google.com/p/go/ #

Patch Set 4 : diff -r 84582b0431a1 https://code.google.com/p/go/ #

Total comments: 4

Patch Set 5 : diff -r aa03e1f59b18 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+379 lines, -98 lines) Patch
M misc/pprof View 1 2 3 11 chunks +24 lines, -11 lines 0 comments Download
A src/cmd/addr2line/main.c View 1 2 3 4 1 chunk +68 lines, -0 lines 0 comments Download
M src/cmd/dist/build.c View 1 2 3 4 36 chunks +52 lines, -48 lines 0 comments Download
A src/cmd/objdump/main.c View 1 1 chunk +68 lines, -0 lines 0 comments Download
M src/libmach/8db.c View 1 2 chunks +14 lines, -9 lines 0 comments Download
M src/pkg/runtime/lock_futex.c View 1 2 chunks +10 lines, -2 lines 0 comments Download
M src/pkg/runtime/lock_sema.c View 1 3 chunks +11 lines, -0 lines 0 comments Download
M src/pkg/runtime/os_darwin.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M src/pkg/runtime/os_freebsd.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/runtime/os_netbsd.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/runtime/os_openbsd.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/runtime/pprof/pprof.go View 1 2 chunks +3 lines, -3 lines 0 comments Download
M src/pkg/runtime/pprof/pprof_test.go View 1 2 chunks +10 lines, -2 lines 0 comments Download
M src/pkg/runtime/proc.c View 1 4 chunks +7 lines, -2 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 3 4 1 chunk +10 lines, -0 lines 0 comments Download
M src/pkg/runtime/signal_darwin_386.c View 1 2 chunks +3 lines, -2 lines 0 comments Download
M src/pkg/runtime/signal_darwin_amd64.c View 1 4 chunks +5 lines, -4 lines 0 comments Download
M src/pkg/runtime/signal_unix.c View 1 1 chunk +3 lines, -3 lines 0 comments Download
M src/pkg/runtime/sys_darwin_386.s View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/pkg/runtime/sys_darwin_amd64.s View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/thread_darwin.c View 1 5 chunks +46 lines, -3 lines 0 comments Download
M src/pkg/runtime/thread_freebsd.c View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M src/pkg/runtime/thread_linux.c View 1 2 3 4 2 chunks +7 lines, -1 line 0 comments Download
M src/pkg/runtime/thread_netbsd.c View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M src/pkg/runtime/thread_openbsd.c View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M src/pkg/runtime/thread_plan9.c View 1 2 3 4 2 chunks +7 lines, -1 line 0 comments Download
M src/pkg/runtime/thread_windows.c View 1 2 3 4 2 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 7
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
12 years, 1 month ago (2012-02-26 20:01:16 UTC) #1
bradfitz
LGTM Didn't review the addr2line and objdump parts incredibly deeply, though. On Mon, Feb 27, ...
12 years, 1 month ago (2012-02-27 00:45:56 UTC) #2
mikio
freebsd requires runtime.setprof too.
12 years, 1 month ago (2012-02-27 01:43:21 UTC) #3
r
LGTM (modulo freebsd) http://codereview.appspot.com/5697066/diff/4001/src/pkg/runtime/pprof/pprof_test.go File src/pkg/runtime/pprof/pprof_test.go (right): http://codereview.appspot.com/5697066/diff/4001/src/pkg/runtime/pprof/pprof_test.go#newcode27 src/pkg/runtime/pprof/pprof_test.go:27: if strings.Contains(vers, "Darwin Kernel Version 10.8.0") ...
12 years, 1 month ago (2012-02-28 10:45:24 UTC) #4
iant
LGTM http://codereview.appspot.com/5697066/diff/4001/src/cmd/addr2line/main.c File src/cmd/addr2line/main.c (right): http://codereview.appspot.com/5697066/diff/4001/src/cmd/addr2line/main.c#newcode18 src/cmd/addr2line/main.c:18: fprint(2, "reads symbols from standard input and writes ...
12 years, 1 month ago (2012-02-28 19:09:50 UTC) #5
rsc
On Tue, Feb 28, 2012 at 14:09, <iant@golang.org> wrote: > This is a change on ...
12 years, 1 month ago (2012-02-28 19:49:35 UTC) #6
rsc
12 years, 1 month ago (2012-02-28 21:18:28 UTC) #7
*** Submitted as http://code.google.com/p/go/source/detail?r=08554467526f ***

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 issue 2008.

R=golang-dev, bradfitz, mikioh.mikioh, r, iant
CC=golang-dev
http://codereview.appspot.com/5697066
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b