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

cmd/pprof: -weblist and -output don't play well together #13413

Closed
lorenzb opened this issue Nov 26, 2015 · 3 comments
Closed

cmd/pprof: -weblist and -output don't play well together #13413

lorenzb opened this issue Nov 26, 2015 · 3 comments

Comments

@lorenzb
Copy link

lorenzb commented Nov 26, 2015

This issue isn't very serious but can be annoying nevertheless.

What version of Go are you using (go version)?

go 1.5.1 (the issue also exists in tip)

What operating system and processor architecture are you using?

not applicable

What did you do?

I was working on a headless system.
I wanted to analyse profiling output by running go tool pprof -weblist=. -output=listing.html myprogram myprogram.pprof and copying the resulting listing.html file to my workstation for viewing.

What did you expect to see?

I expected that there would be a file named listing.html containing the profiling report.

What did you see instead?

$ go tool pprof -weblist=. -output=listing.html myprogram myprogram.pprof
Generating report in listing.html
exec: "firefox": executable file not found in $PATH

The file listing.html was created, but remained empty.

Note that the same command works if I use -list instead of -weblist.

I think that the default behaviour of opening a browser to display the report is very convenient. But if the user specifies -output, that choice should either be respected or a warning (e.g. "warning : flag -output ignored for -weblist output format") should be printed. In no case an empty listing.html file should be generated.

As a workaround, I placed a small script named firefox in my $PATH; the script copies the report to a directory of my choice.

@lorenzb
Copy link
Author

lorenzb commented Nov 26, 2015

I'd be happy to contribute a patch if the Go maintainers are interested.

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Nov 29, 2015
@ianlancetaylor
Copy link
Contributor

Sure, send a patch. At this point it would be for the 1.7 release.

@agnivade
Copy link
Contributor

This works now for 1.11.

18:56:57-agniva-~/play/go/src/github.com/agnivade/levenshtein$go tool pprof -weblist=. -output=list.html levenshtein.test cpu.prof
Generating report in list.html
18:57:14-agniva-~/play/go/src/github.com/agnivade/levenshtein$ls -l list.html 
-rw-rw-r-- 1 agniva agniva 4026138 Sep 30 18:57 list.html

Closing.

@golang golang locked and limited conversation to collaborators Sep 30, 2019
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

4 participants