diff options
author | Russ Cox <rsc@golang.org> | 2016-11-03 09:13:16 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2016-11-03 14:27:11 +0000 |
commit | 89ccd5795c5e41ef478eab3d4a292a836a7fe3ad (patch) | |
tree | 4a50bfe4c09b5bfd942176666ef998e810c8a860 /src/cmd/pprof | |
parent | 8eb9fdaa0123fc98cb70f58801eb74c8a6f92817 (diff) | |
download | go-89ccd5795c5e41ef478eab3d4a292a836a7fe3ad.tar.gz go-89ccd5795c5e41ef478eab3d4a292a836a7fe3ad.zip |
cmd/pprof: use correct default handler for Go programs
The original go tool pprof (written in Perl) got this right.
The Go rewrite never has, but should.
Change-Id: Ie1fc571214c61b1b5654a0bc90e15eb889adf059
Reviewed-on: https://go-review.googlesource.com/32617
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/pprof')
-rw-r--r-- | src/cmd/pprof/internal/driver/driver.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/pprof/internal/driver/driver.go b/src/cmd/pprof/internal/driver/driver.go index 344d458e13..931985a7f2 100644 --- a/src/cmd/pprof/internal/driver/driver.go +++ b/src/cmd/pprof/internal/driver/driver.go @@ -28,6 +28,9 @@ import ( "internal/pprof/profile" ) +// cpuProfileHandler is the Go pprof CPU profile handler URL. +const cpuProfileHandler = "/debug/pprof/profile" + // PProf acquires a profile, and symbolizes it using a profile // manager. Then it generates a report formatted according to the // options selected through the flags package. @@ -160,10 +163,10 @@ func adjustURL(source string, sec int, ui plugin.UI) (adjusted, host string, dur switch strings.ToLower(url.Path) { case "", "/": // Apply default /profilez. - url.Path = "/profilez" + url.Path = cpuProfileHandler case "/protoz": // Rewrite to /profilez?type=proto - url.Path = "/profilez" + url.Path = cpuProfileHandler values.Set("type", "proto") } |