From: Sean Liao Date: Fri, 19 May 2023 18:39:29 +0000 (+0100) Subject: net/http/pprof: document query params X-Git-Tag: go1.21rc1~401 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a0d53199b710bf7cbb8516c2d4ca0e02e15658e0;p=gostls13.git net/http/pprof: document query params Fixes #59452 Change-Id: Ia0b5a03565f663190c480ef9e26309fa85ff192c Reviewed-on: https://go-review.googlesource.com/c/go/+/496144 Reviewed-by: Ian Lance Taylor TryBot-Result: Gopher Robot Reviewed-by: Dmitri Shuralyov Run-TryBot: Ian Lance Taylor Auto-Submit: Ian Lance Taylor --- diff --git a/src/net/http/pprof/pprof.go b/src/net/http/pprof/pprof.go index db03af1c44..385eb423f7 100644 --- a/src/net/http/pprof/pprof.go +++ b/src/net/http/pprof/pprof.go @@ -27,6 +27,15 @@ // If you are not using DefaultServeMux, you will have to register handlers // with the mux you are using. // +// # Parameters +// +// Parameters can be passed via GET query params: +// +// - debug=N (all profiles): response format: N = 0: binary (default), N > 0: plaintext +// - gc=N (heap profile): N > 0: run a garbage collection cycle before profiling +// - seconds=N (allocs, block, goroutine, heap, mutex, threadcreate profiles): return a delta profile +// - seconds=N (cpu (profile), trace profiles): profile for the given duration +// // # Usage examples // // Use the pprof tool to look at the heap profile: