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

Add 'lazy_symbolication' config #2958

Merged
merged 1 commit into from
Jan 26, 2024
Merged

Conversation

jordalgo
Copy link
Contributor

@jordalgo jordalgo commented Jan 25, 2024

This can be used to lazily symbolize userspace symbols instead of loading the entire symbol table ahead of time.

This is useful for when tracing large binaries.

Checklist
  • Language changes are updated in man/adoc/bpftrace.adoc and if needed in docs/reference_guide.md
  • User-visible and non-trivial changes updated in CHANGELOG.md
  • The new behaviour is covered by tests

@jordalgo
Copy link
Contributor Author

not sure how to test this - it seems that even setting lazy_symbolize to numbers other than 1 or 0 don't cause any "noticeable" issues - maybe the errors get swallowed.

@jordalgo
Copy link
Contributor Author

jordalgo commented Jan 25, 2024

The other motivation for this change is so Meta doesn't have to supply a patch to hard code this value to 1 due to the size of some of the binaries that it traces against.

@viktormalik
Copy link
Contributor

Should we also add this as a config option?

@jordalgo
Copy link
Contributor Author

Should we also add this as a config option?

I started down that path but because this is more specific to the environment or binary target (so yeah maybe a case for specific uprobes), I thought it better as just an env var but I don't feel strongly.

@ajor
Copy link
Member

ajor commented Jan 25, 2024

I think "symbolication" is the more accepted term over "symbolization". Some quick searching backs this up, e.g. https://lldb.llvm.org/use/symbolication.html

I'm also biased because I don't like the American spelling of "symbolisation" ;)

@jordalgo
Copy link
Contributor Author

Ah great. @ajor is starting a culture war...

I honestly don't feel strongly though BPFTRACE_LAZY_SYMBOLICATE is more letters AND the actual bcc field is "lazy_symbolize". That being said, in casual conversation I do tend to say "symbolication" so I yield to the wise recommendations of the bpftrace maintainers. But "analyse" is wrong.

@viktormalik
Copy link
Contributor

Should we also add this as a config option?

I started down that path but because this is more specific to the environment or binary target (so yeah maybe a case for specific uprobes), I thought it better as just an env var but I don't feel strongly.

The scripts usually contain the binary target (as a part of uprobes), so IMHO it makes sense to be able to set this in the script via a config option.

@jordalgo
Copy link
Contributor Author

Ok, changed it to 'BPFTRACE_LAZY_SYMBOLICATION' and added it to the config.

Copy link
Member

@ajor ajor left a comment

Choose a reason for hiding this comment

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

Otherwise looks good!

@jordalgo jordalgo force-pushed the lazy-symbolize branch 2 times, most recently from 327ef4a to 0d7a272 Compare January 25, 2024 20:32
@jordalgo jordalgo changed the title Add 'BPFTRACE_LAZY_SYMBOLIZE' Add 'lazy_symbolication' config Jan 25, 2024
This can be used to lazily symbolicate userspace symbols instead
of loading the entire symbol table ahead of time.

This is useful for when tracing large binaries.
@ajor ajor merged commit 0291e97 into bpftrace:master Jan 26, 2024
@jordalgo jordalgo deleted the lazy-symbolize branch February 11, 2025 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants