Skip to content
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

runtime/pprof,cmd/compile: simplified symbol names for generics break PGO matching #58712

Open
prattmic opened this issue Feb 24, 2023 · 2 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@prattmic
Copy link
Member

prattmic commented Feb 24, 2023

For functab, and thus stack traces and symbol names in pprof profile outputs, the compiler simplifies symbol names like foo[go.shape.int64] to just foo[...].

When reading a profile for PGO, the compiler will attempt to match symbols and fail because the profile symbol name does not match the actual symbol name.

This could be addressed from either end:

  • The profile could contain the full symbol name (Function.name = "foo[...]", Function.system_name = "foo[go.shape.int64]" perhaps?).
  • Or, the compiler could match foo[...] to any instantiation of foo.

cc @cherrymui @aclements

@prattmic prattmic added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Feb 24, 2023
@prattmic prattmic added this to the Go1.21 milestone Feb 24, 2023
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Feb 24, 2023
@cherrymui
Copy link
Member

I'd prefer the first option. For the same generic function, some instantiation may be hot and some other may be cold. So it would be good to distinguish them. Especially if we want to do PGO-based specification/stenciling later.

@cherrymui
Copy link
Member

I'll look into it.

@cherrymui cherrymui self-assigned this Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
Status: Todo
Development

No branches or pull requests

3 participants