-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
x/tools/gopls/internal/telemetry/cmd/stacks: automate stack context #64654
Comments
Shallow cloning is the easy part. Parsing the stack frame out of the symbol name is the tricky bit. Consider this line from #66490:
If I understand correctly, this refers to a call 5 lines into an anonymous function defined within protocol.ServerHandler, which is inlined into (*streamServer).ServeStream, and because of the inlining becomes the third anonymous function within the combined function. The actual package name (protocol) isn't even mentioned! So not only do you have to parse the symbol name quite carefully, it then needs resolving relative to type information. Inlining should be a compiler implementation detail. Instead of printing the runtime's inline-mangled symbol name, we should resolve it to a logical (file name, relative line, function name) triple upfront in x/telemetry's crashmonitor (#66517). This will break all our existing counter names, but will allow us to automate more of the triage burden. |
Here is more information about steps to accomplish this: In order to do so, we'd need to:
@h9jiang this may be a good project to get some experience with go/packages. Tentatively assigning. |
...and GOLTOOCHAIN?
Given that it appears we are not going to change the format produced by telemetry, the challenge here is to accurately reverse-engineer the symbol names actually produced by the compiler; see #64654 (comment) for some of the challenges. You may want to discuss with the compiler & runtime folks before spending too much time on heuristics.
I agree. I think it would be best to consider the problem as a sequence of steps.
|
Reminder issue: we should automate the context added to issues created by the
stacks
command (https://github.com/golang/go/issues?q=is%3Aissue+is%3Aopen+label%3Agopls%2Ftelemetry-wins).In order to do this, we need a
func(symbol, tag string) (linenumber int)
in order to build the source location. Our benchmarks have some helpers to shallow clone, which we could extract and reuse.Since we may need to adjust the relevant source location, we should make this functionality available as a subcommand (in addition to guessing it in the initial issue template). E.g.
stacks context golang.org/x/tools/gopls/internal/server.diagnose 23
.CC @adonovan
The text was updated successfully, but these errors were encountered: