]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add support for telemetry
authorMichael Matloob <matloob@golang.org>
Mon, 11 Mar 2024 20:11:39 +0000 (16:11 -0400)
committerMichael Matloob <matloob@golang.org>
Thu, 9 May 2024 16:18:10 +0000 (16:18 +0000)
commit483a913a55215a063ee7a7f218e9ed8f3c7ba21b
tree6d83aad1e945a91adf04bd671335b98bf7effc07
parent805f6b3f5db714ce8f7dae2776748f6df96f288b
cmd/compile: add support for telemetry

Add cmd/internal/telemetry to cmd/dist's bootstrapDirs so it's built
when bootstrapping the compiler. cmd/internal/telemetry is a wrapper
arount telemetry functions that stubs out the functions when built in
bootstrap mode to avoid dependencies on x/telemetry in bootstrap mode.

Call telemetry.Start with an empty config to open the counter file, and
increment a counter for when the command is invoked.

After flags are parsed, increment a counter for each of the names of the
flags that were passed in. The counter names will be compile/flag:<name>
so for example we'll have compile/flag:e and compile/flag:E.

In FatalfAt, increment a stack counter for internal errors.

For #58894

Change-Id: Ia5a8a63aa43b2276641181626cbfbea7e4647faa
Reviewed-on: https://go-review.googlesource.com/c/go/+/570679
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/base/flag.go
src/cmd/compile/internal/base/print.go
src/cmd/compile/internal/gc/main.go
src/cmd/dist/buildtool.go