import (
"cmd/internal/cov/covcmd"
+ "cmd/internal/telemetry"
"encoding/json"
"flag"
"fmt"
objabi.AddVersionFlag() // -V
registerFlags()
objabi.Flagparse(usage)
+ telemetry.CountFlags("compile/flag:", *flag.CommandLine)
if gcd := os.Getenv("GOCOMPILEDEBUG"); gcd != "" {
// This will only override the flags set in gcd;
"strings"
"cmd/internal/src"
+ "cmd/internal/telemetry"
)
// An errorMsg is a queued error message, waiting to be printed.
FatalfAt(Pos, format, args...)
}
+var bugStack = telemetry.NewStackCounter("compile/bug", 16) // 16 is arbitrary; used by gopls and crashmonitor
+
// FatalfAt reports a fatal error - an internal problem - at pos and exits.
// If other errors have already been printed, then FatalfAt just quietly exits.
// (The internal problem may have been caused by incomplete information
func FatalfAt(pos src.XPos, format string, args ...interface{}) {
FlushErrors()
+ bugStack.Inc()
+
if Debug.Panic != 0 || numErrors == 0 {
fmt.Printf("%v: internal compiler error: ", FmtPos(pos))
fmt.Printf(format, args...)
"cmd/internal/obj"
"cmd/internal/objabi"
"cmd/internal/src"
+ "cmd/internal/telemetry"
"flag"
"fmt"
"internal/buildcfg"
// code, and finally writes the compiled package definition to disk.
func Main(archInit func(*ssagen.ArchInfo)) {
base.Timer.Start("fe", "init")
+ telemetry.Start()
+ telemetry.Inc("compile/invocations")
defer handlePanic()