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>.profsigprof loads its configuration from the following environment variables.
USR1_PROF- Profile executed on theUSR1signal. Default:goroutineUSR2_PROF- Profile executed on theUSR2signal. Default:heapSIG_PROF_OUT- Specify the output location, eitherfile,stderr, orstdout. Default:file.