-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: web/weblist visualization failure caused by incorrect web browser invocation is hard to debug #25853
Comments
There must be something in your program which produces some side effect resulting in this. Maybe your program writes into stdout/stderr. Can you paste your program? |
@ysmolsky it turns out I had a The reason this has been working for most people on Mac, I assume, is because of the last command My suggestion is to add the real Chrome path mentioned above as one of the mac os commands to run. Probably in line 343 for reference: https://github.com/google/pprof/blob/master/internal/driver/commands.go#L340-L343 Happy to hear your thoughts and submit a pr unless you see something incorrect about my assumptions above. Thanks |
@marwan-at-work |
@ysmolsky I agree with the specific path to Chrome (although this is the default binary path for every macOS chrome browser). Furthermore, I personally have never seen I wonder if there's a way to warn the user so they wouldn't spend 3-5 hours like I did being confused as to why "chrome" wasn't working with pprof. Maybe just default to Thanks! |
One thing that I have noticed is that pprof does not report an error when the first found vizualizer have returned an error: % cat $(which chrome)
#!/bin/sh
echo ERROR
exit 1
% go tool pprof prof.prof
Main binary filename not available.
Type: cpu
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) web
(pprof) That means that I cannot reproduce your problem. Also did you run Wait a second. The Ping @hyangah for some ideas. |
@ysmolsky the error that i got was actually from the "random" |
I filed a new issue in google/pprof. That's a better place for the discussion. |
@hyangah it did not. |
Good. Thanks for the update. I will close this bug for now. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.10.3
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOOS="darwin"
What did you do?
Running a simple profiler with the following two lines of code:
Create a file with output such as
cpu.prof
and runpprof cpu.prof
In the CLI, run
web
to open up a webpageor run
weblist <function-name>
What did you expect to see?
A web page with the profile svg or html correctly displayed.
What did you see instead?
Noting that the file (pprof002.svg) actually does exist under
/var/folders/n4/35bgdnkd6vlgqrdzbyl0x1ycmhcndx/T/pprof002.svg
but not/Users/xxx/go/src/github.com/marwan-at-work/xxx/var/folders/n4/35bgdnkd6vlgqrdzbyl0x1ycmhcndx/T/pprof002.svg
The text was updated successfully, but these errors were encountered: