Golang package for inspecting running processes. Similar to net/http/pprof but using USR1
and USR2
signals instead of HTTP server routes.
Link the package:
import _ "github.com/tam7t/sigprof"
Send the USR1
or USR2
signal to inspect the process.
kill -usr1 <golang process pid>
The default USR1
profile is goroutine. By default, sigprof
will save results to timestamped files.
go tool pprof profile-<timestamp>.prof
sigprof
loads its configuration from the following environment variables.
USR1_PROF
- Profile executed on theUSR1
signal. Default:goroutine
USR2_PROF
- Profile executed on theUSR2
signal. Default:heap
SIG_PROF_OUT
- Specify the output location, eitherfile
,stderr
, orstdout
. Default:file
.