Documentation
¶
Overview ¶
Package profiling writes Go runtime profiles when PIG_PROFILE names them.
With PIG_PROFILE unset, Start performs one environment lookup and returns a no-op, so release binaries pay nothing for the capability. With it set, pig profiles the whole process and writes the files on exit:
PIG_PROFILE=cpu,heap pig -p "hello" PIG_PROFILE=trace PIG_PROFILE_DIR=/tmp/pig-profile pig
Kinds are cpu, heap, allocs, block, mutex, goroutine, and trace. Files go to PIG_PROFILE_DIR (default: the current directory) as pig-<pid>-<kind>.pprof, or pig-<pid>.trace for the execution trace. Read them with `go tool pprof` and `go tool trace`, or run `make profile` from a source checkout.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Kinds = []string{"cpu", "heap", "allocs", "block", "mutex", "goroutine", "trace"}
Kinds lists the accepted PIG_PROFILE values in the order they are written.
Functions ¶
Types ¶
This section is empty.