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: allow auto assigned http port #39820

Closed
howardjohn opened this issue Jun 24, 2020 · 5 comments
Closed

cmd/pprof: allow auto assigned http port #39820

howardjohn opened this issue Jun 24, 2020 · 5 comments
Labels
FeatureRequest FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@howardjohn
Copy link
Contributor

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

$ go version
go version go1.14.2 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/howardjohn/.cache/go-build"
GOENV="/home/howardjohn/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/howardjohn/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/howardjohn/go/src/istio.io/istio/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build230957294=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Ran go tool pprof --http=:0 /tmp/profile

What did you expect to see?

A browser window opens to localhost:<SOME_RANDOM_PORT>, where the port is autoassigned from a random free port

What did you see instead?

Browser opens to localhost:0 which doesn't work

This would be useful so I don't have to worry about manually changing ports when viewing multiple profiles

@cagedmantis cagedmantis added this to the Backlog milestone Jun 25, 2020
@cagedmantis cagedmantis changed the title pprof: allow auto assigned http port cmd/pprof: allow auto assigned http port Jun 25, 2020
@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 25, 2020
@cagedmantis
Copy link
Contributor

/cc @hyangah

@davecheney
Copy link
Contributor

Use -htttp=:

@howardjohn
Copy link
Contributor Author

Thanks @davecheney ! I verified that works and its actually pretty well documented I just didn't read it well

Misc options:
-http Provide web interface at host:port.
Host is optional and 'localhost' by default.
Port is optional and a randomly available port by default

@hyangah
Copy link
Contributor

hyangah commented Jun 25, 2020

Filed google/pprof#546 upstream.

@hyangah
Copy link
Contributor

hyangah commented Jun 25, 2020

Oh. ok.

@golang golang locked and limited conversation to collaborators Jun 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants