When we run the stacks command to extract information from recent stacks, it would be extremely useful to associate stack information with source links to go.googlesource.com or cs.opensource.google.

In order to do so, we'd need to:

  1. For each stack program, check out the repo for that program at the correct version (for now, we can hard-code a list of program repos, but eventually we can also use origin information from the proxy (e.g., for gopls.
  2. Use go/packages to load package information for the stack using the correct GOOS/GOARCH combination corresponding to the report.
  3. Look up symbols in in the package, and translate line offsets in function bodies to absolute line positions.
  4. Update the output of the stacks command to support html output, so that we can format nicely linkified stack information (perhaps an -html flag can generate an html summary which can be opened in the browser? I'm not sure here how best to serve the information.

For now, the stacks command is the most appropriate place to implement this logic, but one can imagine that it could also be useful as integration with e.g. gaby, or telemetry.go.dev.

CC @adonovan @h9jiang @golang/telemetry

Comment From: gabyhelp

Related Issues and Documentation

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

Comment From: findleyr

Aha, complete dupe. Perhaps I didn't find it because it wasn't part of the telemetry project or labeled with telemetry.

Perhaps gaby should suggest labels and projects.