pprof and GOROOT_FINAL

16 views
Skip to first unread message

Dave Cheney

unread,
Mar 3, 2012, 7:56:53 PM3/3/12
to golang-dev
Hello,

I've run into a (minor) problem using pprof and a packaged go
installation which was built with GOLANG_FINAL. For example, this
happens when using the Canonical provided golang-tip ppa.

lucky(~/devel/src/code.google.com/p/go.crypto/ssh) % alias profile='go
test -c && ./*.test -test.run=XXX -test.bench=.
-test.cpuprofile=cpu.prof && go tool pprof *.test cpu.prof'
lucky(~/devel/src/code.google.com/p/go.crypto/ssh) % profile
PASS
BenchmarkMarshalKexInitMsg 20000 67233 ns/op
BenchmarkUnmarshalKexInitMsg 10000 146027 ns/op
BenchmarkMarshalKexDHInitMsg 200000 10280 ns/op
BenchmarkUnmarshalKexDHInitMsg 500000 5575 ns/op
Welcome to pprof! For help, type 'help'.
(pprof) top10
Total: 858 samples
62 7.2% 7.2% 261 30.4% runtime.mallocgc
45 5.2% 12.5% 357 41.6% code.google.com/p/go.crypto/ssh.marshal
40 4.7% 17.1% 74 8.6% sweep
32 3.7% 20.9% 52 6.1% reflect.Value.Index
31 3.6% 24.5% 334 38.9% code.google.com/p/go.crypto/ssh.unmarshal
30 3.5% 28.0% 30 3.5% scanblock
29 3.4% 31.4% 43 5.0% copyout
29 3.4% 34.7% 29 3.4% runtime.markallocated
24 2.8% 37.5% 52 6.1% assertE2Tret
24 2.8% 40.3% 181 21.1% runtime.makeslice
(pprof) list mallocgc
Total: 858 samples
/build/buildd/golang-tip-12420/src/pkg/runtime/malloc.goc: No such
file or directory

pprof is using the original GOROOT path defined when the deb was
built, not the value of GOROOT_FINAL.

I know that rsc has a CL out that makes some changes to import paths,
will this fix the issue above, or should I raise this on the issue
tracker ?

Cheers

Dave

Reply all
Reply to author
Forward
0 new messages