Documentation
¶
Overview ¶
labeloffsetprobe is a development-only tool that captures a live heap dump from itself and probes for the byte offset of runtime.g.labels in the running Go runtime. Its output is a candidate runtimelayout.TableEntry that can be pasted into internal/runtimelayout/table.go to extend /debug/memusage support to a new Go version.
Usage:
go run ./cmd/labeloffsetprobe
Heap-allocated label strings are used for the probe so the bytes are guaranteed to appear in the heap dump object contents on every platform, independent of whether the in-process memory reader is available. The probe also opens the in-process reader (if supported on this OS) and prints which source it ended up using — useful when diagnosing FreeBSD configurations where procfs is unmounted and the ELF fallback applies.