Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc/pprof: profiler is broken on windows #7406

Closed
alexbrainman opened this issue Feb 25, 2014 · 14 comments
Closed

misc/pprof: profiler is broken on windows #7406

alexbrainman opened this issue Feb 25, 2014 · 14 comments
Milestone

Comments

@alexbrainman
Copy link
Member

C:\go\root\src\pkg\archive\zip>hg st

C:\go\root\src\pkg\archive\zip>hg id
4ab152b54171 tip

C:\go\root\src\pkg\archive\zip>go test -c && zip.test.exe -test.v
-test.run=none -test.bench=.*  -test.cpuprofile test.prof && go tool pprof
zip.test.exe test.prof
PASS
BenchmarkCompressedZipGarbage         50          59687882 ns/op           67809 B/op   
    148 allocs/op
BenchmarkZip64Test             5         409377620 ns/op
Welcome to pprof!  For help, type 'help'.
(pprof) top
Total: 514 samples
     514 100.0% 100.0%      514 100.0% ?
(pprof) quit

C:\go\root\src\pkg\archive\zip>

rsc asked to create an issue here https://golang.org/cl/66020043/#msg11

Alex

Attachments:

  1. zip.test.exe (3006976 bytes)
  2. test.prof (11816 bytes)
@alexbrainman
Copy link
Member Author

Comment 1:

Labels changed: added release-go1.3.

@rsc
Copy link
Contributor

rsc commented Apr 3, 2014

Comment 2:

This will start working once objdump and nm work.

@alexbrainman
Copy link
Member Author

Comment 3:

This is still broken. I suspect it is because of issue #7899.
Alex

@gopherbot
Copy link

Comment 4:

CL https://golang.org/cl/96960043 mentions this issue.

@alexbrainman
Copy link
Member Author

Comment 6:

This issue was updated by revision b211d06.

Fixes issue #7899
LGTM=bradfitz
R=golang-codereviews, rsc, bradfitz
CC=golang-codereviews
https://golang.org/cl/96960043

@alexbrainman
Copy link
Member Author

Comment 7:

Making progress here. This is now works:
C:\go\root\src\pkg\archive\zip>go test -c && zip.test.exe -test.v -test.run=none
-test.bench=.*  -test.cpuprofile test.prof && go tool pprof zip.test.exe test.prof
PASS
BenchmarkCompressedZipGarbage         50          51874336 ns/op           51838 B/op   
    148 allocs/op
BenchmarkZip64Test             5         409369760 ns/op
Welcome to pprof!  For help, type 'help'.
(pprof) top
Total: 477 samples
     141  29.6%  29.6%      195  40.9% compress/flate.(*compressor).deflate
     126  26.4%  56.0%      128  26.8% archive/zip.(*rleBuffer).ReadAt
      85  17.8%  73.8%       85  17.8% archive/zip.(*rleBuffer).Write
      50  10.5%  84.3%       50  10.5% compress/flate.(*compressor).findMatch
      47   9.9%  94.1%       47   9.9% hash/crc32.update
      14   2.9%  97.1%       14   2.9% runtime.memmove
       2   0.4%  97.5%        2   0.4% compress/flate.(*compressor).reset
       2   0.4%  97.9%        2   0.4% compress/flate.(*huffmanBitWriter).writeBits
       2   0.4%  98.3%        4   0.8% compress/flate.(*huffmanBitWriter).writeBlock
       2   0.4%  98.7%      130  27.3% io.(*SectionReader).Read
but source code displaying
       
(pprof) list findMatch
Total: 477 samples
ROUTINE ====================== compress/flate.(*compressor).findMatch in
c:/go/root/src/pkg/archive/zip/reader.go
    50     50 Total samples (flat / cumulative)---
    50     50    1: // Copyright 2010 The Go Authors. All rights reserved.---
     .      .    2: // Use of this source code is governed by a BSD-style
     .      .    3: // license that can be found in the LICENSE file.
     .      .    4:
     .      .    5: package zip
     .      .    6:
(pprof)
does not. objdump is still broken on windows. I think working objdump will fix pprof
"list" command.
Alex

@gopherbot
Copy link

Comment 8:

CL https://golang.org/cl/95090044 mentions this issue.

@alexbrainman
Copy link
Member Author

Comment 9:

This issue was updated by revision 20aa947.

Fixes issue #7937
LGTM=iant
R=golang-codereviews, iant, 0intro
CC=golang-codereviews
https://golang.org/cl/95090044

@rsc
Copy link
Contributor

rsc commented May 13, 2014

Comment 10:

Alex, does source code listing work now? It should.
That is, 'list findMatch' should work in the transcript above.
I expect 'disasm findMatch' to not work yet, but that's no different than pprof anywhere
else.
If 'list findMatch' is working, please mark this bug fixed.

@alexbrainman
Copy link
Member Author

Comment 11:

'list findMatch' works only after I change misc/pprof to use "go tool objdump ..."
instead of "objdump .. ". I was going to find out if 'list findMatch' ever worked before
on windows, and how. But perhaps it is not important. Would change to misc/pprof be
welcome instead?
Alex

@rsc
Copy link
Contributor

rsc commented May 13, 2014

Comment 12:

Yes, pprof should be using 'go tool objdump' on Windows now.

@alexbrainman
Copy link
Member Author

Comment 13:

mingw objdump also used in ParseTextSectionHeaderFromObjdump in misc/pprof. What about
that? "go tool objdump" does not implement such function.
Alex

@gopherbot
Copy link

Comment 14:

CL https://golang.org/cl/97440043 mentions this issue.

@alexbrainman
Copy link
Member Author

Comment 15:

This issue was closed by revision fcfc17f.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants