Output the report through UI
Please answer these questions before submitting your issue. Thanks!
What version of pprof are you using?
If you are using pprof via go tool pprof, what's your go env output?
GO111MODULE="auto"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/ianwoolf/Library/Caches/go-build"
GOENV="/Users/ianwoolf/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/ianwoolf/code/go/pkg/mod"
GOOS="darwin"
GOPATH="/Users/ianwoolf/code/go"
GOPROXY="https://goproxy.io,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.16.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/ianwoolf/code/go/src/github.com/google/pprof/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 -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/3f/x8jl0lgx629d_5bz0537gxnm0000gn/T/go-build3760221418=/tmp/go-build -gno-record-gcc-switches -fno-common"
What operating system and processor architecture are you using?
Linux, but this issue is agnostic of operating system
What did you do?
The system configuration causes some system calls to occupy too much cpu. So I want to expose the cpu analysis results of pprof (such as top) and send it to other service such as monitoring and elassticsearch. But unfortunately, pprof/driver did not expose internal/driver.AddCommand, which made it impossible to output the result through Options.UI.
detail:
https://github.com/google/pprof/blob/master/internal/driver/commands.go#L93 https://github.com/google/pprof/blob/master/internal/driver/driver.go#L134
In our internal version of go, we resolved this problem. The monitoring system will periodically grab the cpu analysis results of the online service through http for monitoring and performance analysis.
What did you expect to see?
I can call driver.AddCommand to set the visualizer of a command, so i can output the result throught the interface option.UI.
or a func like driver.UpdateCommand is better?
What did you see instead?
the visualizer of all command is nil,so the output is os.Stdout. i cannot output the profile report through UI.
Is this demand acceptable? It did solve my problem
Or is there any better way?
Closing as we do not plan to expand the pprof API surface.