Documentation
¶
Overview ¶
Package probe adds gogc98 instrumentation to a Go program: an in-process flight recorder plus an HTTP endpoint that serves its latest trace snapshot, in the shape the gogc98 visualizer polls for.
It requires the traceallocfree runtime experiment, which is not in the //go:debug allowlist and so cannot be enabled from within the program itself -- the runtime parses GODEBUG before any Go code runs, including init(). The process must be launched with GODEBUG=traceallocfree=1 already set in its environment; Start logs why and exits the process if it isn't.
Usage is a single line, typically run in its own goroutine since Start blocks:
go probe.Start()
Index ¶
Constants ¶
const Addr = "127.0.0.1:7999"
Addr is where Start serves the snapshot endpoint -- the gogc98 visualizer's default poll target.
Variables ¶
This section is empty.
Functions ¶
func Start ¶
func Start()
Start starts an in-process flight recorder and serves its latest trace snapshot at http://127.0.0.1:7999/snapshot on each request. It blocks, like http.ListenAndServe, so callers typically run it in its own goroutine with go probe.Start().
Types ¶
This section is empty.