aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/nm
diff options
context:
space:
mode:
authorMichael Matloob <matloob@golang.org>2024-06-13 12:38:20 -0400
committerMichael Matloob <matloob@golang.org>2024-06-13 19:19:47 +0000
commitdbe03e4831206d7311e4423c3a988fc48beda2bd (patch)
treea417b2026482689a40634b18a13ed786cc6147d3 /src/cmd/nm
parent956f8a67dd7319bad60c015d982f0b2e95b9f382 (diff)
downloadgo-dbe03e4831206d7311e4423c3a988fc48beda2bd.tar.xz
cmd/go: call telemetry.MaybeChild at start of go command
Call the new telemetry.MaybeChild function at the start of the go command so that the child process logic can be run immediately without running toolchain selection if this is the child process. The Start function in the telemetry shim package has been renamed to OpenCounters to make it clear that that's its only function. The StartWithUpload function in the telemetry shim package has been renamed to MaybeParent because that's its actual effective behavior in cmd/go, the only place it's called: it won't run as the child because MaybeChild has already been called and would have run as the child if the program was the telemetry child, and it won't open counters because telemetry.Start has been called. Checks are added that those functions are always called before so that the function name and comment are accurate. It might make sense to add a true telemetry.MaybeParent function that doesn't try to start the child or open counters to make things a little simpler. Change-Id: Ie81e2418af85cef18ec41f75db66365f6597b8b1 Reviewed-on: https://go-review.googlesource.com/c/go/+/592535 Reviewed-by: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/nm')
-rw-r--r--src/cmd/nm/nm.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/nm/nm.go b/src/cmd/nm/nm.go
index 62cf155362..e0d98d5f6c 100644
--- a/src/cmd/nm/nm.go
+++ b/src/cmd/nm/nm.go
@@ -68,7 +68,7 @@ func (nflag) String() string {
func main() {
log.SetFlags(0)
- telemetry.Start()
+ telemetry.OpenCounters()
flag.Usage = usage
flag.Parse()
telemetry.Inc("nm/invocations")