golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.7k stars 17.5k forks source link

cmd/go: add support for tracing to visualize build behavior #38714

Open matloob opened 4 years ago

matloob commented 4 years ago

I'd like to add a GODEBUG option to cmd/go to emit traces so that we can visualize build behavior. For now it will emit a runtime trace but maybe in the future we might use @ianthehat's events library. Maybe in the future it could become a flag, but for now adding it to GODEBUG should be safe in the sense that it doesn't affect the formal interface of the go command.

matloob commented 4 years ago

cc @bcmills @jayconrod @ianthehat @mvdan

gopherbot commented 4 years ago

Change https://golang.org/cl/230378 mentions this issue: cmd/go: add a trace option to GODEBUG

josharian commented 4 years ago

Tracing like https://github.com/golang/go/issues/15736?

matloob commented 4 years ago

Yes, though my understanding is that --debug-actiongraph only has timing information for build actions, and doesn't cover cmd/go's behavior before actions are executed.

gopherbot commented 4 years ago

Change https://golang.org/cl/237683 mentions this issue: cmd/go: add a debug-trace flag to generate traces

gopherbot commented 4 years ago

Change https://golang.org/cl/237684 mentions this issue: cmd/go: add Context parameter to base.command.Run

gopherbot commented 4 years ago

Change https://golang.org/cl/238541 mentions this issue: cmd/go: propagate context into PackagesForBuild and Do for tracing

gopherbot commented 4 years ago

Change https://golang.org/cl/238542 mentions this issue: cmd/go/internal/trace: add function to distinguish Goroutines

gopherbot commented 4 years ago

Change https://golang.org/cl/238543 mentions this issue: cmd/go: add trace events for each action

gopherbot commented 4 years ago

Change https://golang.org/cl/239083 mentions this issue: cmd/go: mark trace flows between actions

gopherbot commented 4 years ago

Change https://golang.org/cl/239098 mentions this issue: cmd/trace: move viewer data structs into cmd/internal/traceviewer

gopherbot commented 4 years ago

Change https://golang.org/cl/239438 mentions this issue: cmd/go: process -debug-trace flag for cmd/test and cmd/vet

gopherbot commented 4 years ago

Change https://golang.org/cl/239437 mentions this issue: cmd/go: add tracing instrumentation to leod.TestPackagesFor

gopherbot commented 4 years ago

Change https://golang.org/cl/239750 mentions this issue: cmd/go: do context propagation for tracing downloads

gopherbot commented 4 years ago

Change https://golang.org/cl/239749 mentions this issue: cmd/go: add span for modload.LoadBuildList

gopherbot commented 4 years ago

Change https://golang.org/cl/240181 mentions this issue: cmd/go: do context propagation for tracing downloads

gopherbot commented 4 years ago

Change https://golang.org/cl/242365 mentions this issue: cmd/go: add trace spans for the skeleton of get

gopherbot commented 4 years ago

Change https://golang.org/cl/242785 mentions this issue: cmd/go: rewrite mvs.buildList to not use par.Work

gopherbot commented 4 years ago

Change https://golang.org/cl/242786 mentions this issue: cmd/go: add tracing for querying and downloading from the proxy

gopherbot commented 4 years ago

Change https://golang.org/cl/243949 mentions this issue: cmd/go: annotate ImportPathsQuiet and modload.(*loader).doPkg

gopherbot commented 4 years ago

Change https://golang.org/cl/243948 mentions this issue: cmd/go: add tracing to mvs.buildList

gopherbot commented 4 years ago

Change https://golang.org/cl/248322 mentions this issue: cmd/go: mark trace flows between actions

gopherbot commented 4 years ago

Change https://golang.org/cl/248328 mentions this issue: cmd/go: rewrite mvs.buildList to not use par.Work

gopherbot commented 4 years ago

Change https://golang.org/cl/248327 mentions this issue: cmd/go: do context propagation for tracing downloads

gopherbot commented 4 years ago

Change https://golang.org/cl/248324 mentions this issue: cmd/go: process -debug-trace flag for cmd/test and cmd/vet

gopherbot commented 4 years ago

Change https://golang.org/cl/248319 mentions this issue: cmd/go/internal/trace: add function to distinguish goroutines

gopherbot commented 4 years ago

Change https://golang.org/cl/248323 mentions this issue: cmd/go: add tracing instrumentation to load.TestPackagesFor

gopherbot commented 4 years ago

Change https://golang.org/cl/248325 mentions this issue: cmd/go: add span for modload.LoadBuildList

gopherbot commented 4 years ago

Change https://golang.org/cl/248320 mentions this issue: cmd/go: add trace events for each action

gopherbot commented 4 years ago

Change https://golang.org/cl/249017 mentions this issue: cmd/go: revert 3 CLs affecting par.Work, context propagation, tracing

gopherbot commented 4 years ago

Change https://golang.org/cl/249021 mentions this issue: cmd/go: do context propagation for tracing downloads

gopherbot commented 4 years ago

Change https://golang.org/cl/249022 mentions this issue: cmd/go: add tracing for querying and downloading from the proxy

gopherbot commented 2 years ago

Change https://go.dev/cl/419554 mentions this issue: cmd/go: add Context parameter to download function

gopherbot commented 1 year ago

Change https://go.dev/cl/452456 mentions this issue: cmd/go: propagate Context arguments through modfetch methods