Imports #
"os"
"runtime/debug"
"bytes"
"fmt"
"io"
"log"
"os"
"reflect"
"runtime/debug"
"strconv"
"strings"
"golang.org/x/telemetry/internal/counter"
"os"
"runtime/debug"
"bytes"
"fmt"
"io"
"log"
"os"
"reflect"
"runtime/debug"
"strconv"
"strings"
"golang.org/x/telemetry/internal/counter"
(stubbed by test)
var childExitHook = *ast.FuncLit
(stubbed by test)
var incrementCounter = *ast.FuncLit
var setCrashOutput func(*os.File) error
Child runs the part of the crashmonitor that runs in the child process. It expects its stdin to be connected via a pipe to the parent which has run Parent.
func Child()
Parent sets up the parent side of the crashmonitor. It requires exclusive use of a writable pipe connected to the child process's stdin.
func Parent(pipe *os.File)
Supported reports whether the runtime supports [runtime/debug.SetCrashOutput]. TODO(adonovan): eliminate once go1.23+ is assured.
func Supported() bool
func init()
func min(x int, y int) int
parseStackPCs parses the parent process's program counters for the first running goroutine out of a GOTRACEBACK=system traceback, adjusting them so that they are valid for the child process's text segment. This function returns only program counter values, ensuring that there is no possibility of strings from the crash report (which may contain PII) leaking into the telemetry system.
func parseStackPCs(crash string) ([]uintptr, error)
The sentinel function returns its address. The difference between this value as observed by calls in two different processes of the same executable tells us the relative offset of their text segments. It would be nice if SetCrashOutput took care of this as it's fiddly and likely to confuse every user at first.
func sentinel() uint64
telemetryCounterName parses a crash report produced by the Go runtime, extracts the stack of the first runnable goroutine, converts each line into telemetry form ("symbol:relative-line"), and returns this as the name of a counter.
func telemetryCounterName(crash []byte) (string, error)
func writeSentinel(out io.Writer)
Generated with Arrow