Add counters for invocations and provided flag names.
For #58894
Change-Id: Ibd4eeca905d277879b601d95bab524fbced6a98b
Reviewed-on: https://go-review.googlesource.com/c/go/+/584276
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
"cmd/internal/objabi"
"cmd/internal/quoted"
"cmd/internal/sys"
+ "cmd/internal/telemetry"
"cmd/link/internal/benchmark"
"flag"
"internal/buildcfg"
func Main(arch *sys.Arch, theArch Arch) {
log.SetPrefix("link: ")
log.SetFlags(0)
+ telemetry.Start()
+ telemetry.Inc("link/invocations")
thearch = theArch
ctxt := linknew(arch)
objabi.Flagfn1("importcfg", "read import configuration from `file`", ctxt.readImportCfg)
objabi.Flagparse(usage)
+ telemetry.CountFlags("link/flag:", *flag.CommandLine)
if ctxt.Debugvlog > 0 {
// dump symbol info on crash