-
Notifications
You must be signed in to change notification settings - Fork 18k
x/telemetry: gather program counters #73268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Related Issues
Related Documentation (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
Thanks, I think this makes sense and (since we have the binary version anyway) doesn't represent a significant change in the data collected by telemetry--just a refinement from line number to PC granularity. I'm not sure if this will require a version bump in the telemetry file: my guess is not, as long as the new stack format can be parsed by the old upload logic. Needs investigation, but that is an implementation detail. I've promoted this from a Telemetry-Proposal to an actual proposal, since it is proposing a new API rather than new counters. |
It's not an API, it's just a change to the encoding of stacks as counter names. The x/telemetry repo's README warns that it "is intended for use only in tools maintained by the Go team" and provides "no compatibility guarantees". So this doesn't need a proposal. |
Change https://go.dev/cl/664175 mentions this issue: |
The format I used in the CL was: |
Change https://go.dev/cl/666416 mentions this issue: |
Updates golang/go#73268 Change-Id: I13168d1edae1358919e69c7ee965bafd4c6833d0 Reviewed-on: https://go-review.googlesource.com/c/tools/+/666416 Auto-Submit: Alan Donovan <[email protected]> Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
Background: Recently I have been spending a lot of time staring at disassembly of Go executables (specifically gopls) trying to figure out why a process crashed on a line of code that "can't go wrong" according to Go's type system. All we have to go on is the line number. From the line number and pclntab of the reconstructed executable it is possible to compute a set of candidate instructions, but it would be nice to know definitively which one was the culprit.
This information is available to the runtime crash monitor, but it discards it when constructing the names of the stack counters to avoid spurious variation. This was a mistake: we already have to deal with spurious variation in line number perturbation from one version to the next, which we achieve by using the "stacks" expression language to match only the significant portions of the text; the same solution will work even as the variance increases.
Proposal: We should change the format of stack counters to include the relative PC value of each frame. If we do this by appending a suffix to each line, none of our existing "stacks" expressions would need to change.
Example of current format:
Example of proposed format:
@golang/telemetry
The text was updated successfully, but these errors were encountered: