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

lorenzb opened this issue Nov 26, 2015 · 3 comments

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

lorenzb opened this issue Nov 26, 2015 · 3 comments


Copy link

@lorenzb 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.

Copy link

@lorenzb 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
Copy link

@ianlancetaylor ianlancetaylor commented Nov 29, 2015

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

Copy link

@agnivade agnivade commented Sep 30, 2018

This works now for 1.11.

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


@agnivade agnivade closed this Sep 30, 2018
@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.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.