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

Allow symbolz to try symbolize unsymbolizable mappings. #907

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions internal/symbolz/symbolz.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,15 @@ var (
// Symbolize symbolizes profile p by parsing data returned by a symbolz
// handler. syms receives the symbolz query (hex addresses separated by '+')
// and returns the symbolz output in a string. If force is false, it will only
// symbolize locations from mappings not already marked as HasFunctions. Never
// attempts symbolization of addresses from unsymbolizable system
// mappings as those may look negative - e.g. "[vsyscall]".
// symbolize locations from mappings not already marked as HasFunctions. Does
// not skip unsymbolizable files since the symbolz handler can be flexible
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this comment may feel out of context after the patch is submitted and the check on m.Unsymbolizable() is not there anymore. Most people won't think "why aren't we skipping unsymbolizable mappings?".
Maybe just skip the comment here?

Optionally, perhaps the package comments could have a bit more details about symbolz and how it can get symbols for JITed code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mostly added this comment for future us in case we consider adding the unsymbolizable check again.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong opinion about it. We can submit as is.

// enough to handle some of those cases such as JIT locations in //anon.
func Symbolize(p *profile.Profile, force bool, sources plugin.MappingSources, syms func(string, string) ([]byte, error), ui plugin.UI) error {
for _, m := range p.Mapping {
if !force && m.HasFunctions {
// Only check for HasFunctions as symbolz only populates function names.
continue
}
// Skip well-known system mappings.
if m.Unsymbolizable() {
continue
}
mappingSources := sources[m.File]
if m.BuildID != "" {
mappingSources = append(mappingSources, sources[m.BuildID]...)
Expand Down
Loading