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

Probe matcher: don't fail on missing files #2433

Merged
merged 1 commit into from
Nov 22, 2022

Conversation

minipli-oss
Copy link
Contributor

@minipli-oss minipli-oss commented Nov 17, 2022

Even though we rely on ftrace's function tracing functionality to list available probe functions, bpftrace can work without these, e.g. when making use of tracepoints only.

Right now bpftrace -l will die with a std::runtime_error exception if called on a kernel that lacks CONFIG_FUNCTION_TRACER. This isn't exactly user friendly.

Instead of dying by throwing an exception, emit a warning and keep on going.

This makes bpftrace usable on systems that lack CONFIG_FUNCTION_TRACER and/or CONFIG_EVENT_TRACING -- with limited functionality, of course!

Signed-off-by: Mathias Krause minipli@grsecurity.net

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

Copy link
Contributor

@viktormalik viktormalik left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! This is also worth a CHANGELOG entry, can you add it?

Even though we rely on ftrace's function tracing functionality to list
available probe functions, bpftrace can work without these, e.g. when
making use of tracepoints only.

Right now `bpftrace -l` will die with a std::runtime_error exception if
called on a kernel that lacks CONFIG_FUNCTION_TRACER. This isn't exactly
user friendly.

Instead of dying by throwing an exception, emit a warning and keep on
going.

This makes bpftrace usable on systems that lack CONFIG_FUNCTION_TRACER
and/or CONFIG_EVENT_TRACING -- with limited functionality, of course!

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
@minipli-oss
Copy link
Contributor Author

Thanks for the review!

I added the changelog entry and updated the branch.

@viktormalik viktormalik merged commit b4ad691 into bpftrace:master Nov 22, 2022
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.

2 participants