Documentation
¶
Overview ¶
Package debug interfaces Go runtime debugging facilities. This package is mostly glue code making these facilities available through the CLI and RPC subsystem. If you want to use them from Go code, use package runtime instead.
Index ¶
- Variables
- func Exit()
- func LoudPanic(x interface{})
- func Setup(ctx *cli.Context, logdir string) error
- func StartPProf(address string)
- type HandlerT
- func (*HandlerT) BacktraceAt(location string) error
- func (*HandlerT) BlockProfile(file string, nsec uint) error
- func (h *HandlerT) CpuProfile(file string, nsec uint) error
- func (*HandlerT) FreeOSMemory()
- func (*HandlerT) GcStats() *debug.GCStats
- func (h *HandlerT) GoTrace(file string, nsec uint) error
- func (*HandlerT) MemStats() *runtime.MemStats
- func (*HandlerT) MutexProfile(file string, nsec uint) error
- func (*HandlerT) SetBlockProfileRate(rate int)
- func (*HandlerT) SetGCPercent(v int) int
- func (*HandlerT) SetMutexProfileFraction(rate int)
- func (*HandlerT) Stacks() string
- func (h *HandlerT) StartCPUProfile(file string) error
- func (h *HandlerT) StartGoTrace(file string) error
- func (h *HandlerT) StopCPUProfile() error
- func (h *HandlerT) StopGoTrace() error
- func (*HandlerT) Verbosity(level int)
- func (*HandlerT) Vmodule(pattern string) error
- func (*HandlerT) WriteBlockProfile(file string) error
- func (*HandlerT) WriteMemProfile(file string) error
- func (*HandlerT) WriteMutexProfile(file string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Flags = []cli.Flag{
verbosityFlag, vmoduleFlag, backtraceAtFlag, debugFlag,
pprofFlag, pprofAddrFlag, pprofPortFlag,
memprofilerateFlag, blockprofilerateFlag, cpuprofileFlag, traceFlag,
}
Flags holds all command-line flags required for debugging.
View Source
var Handler = new(HandlerT)
Handler is the global debugging handler.
View Source
var Memsize memsizeui.Handler
Functions ¶
func Exit ¶
func Exit()
Exit stops all running profiles, flushing their output to the respective file.
func LoudPanic ¶
func LoudPanic(x interface{})
LoudPanic panics in a way that gets all goroutine stacks printed on stderr.
func Setup ¶
Setup initializes profiling and logging based on the CLI flags. It should be called as early as possible in the program.
func StartPProf ¶
func StartPProf(address string)