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 fentry/fexit aliases for kfunc/kretfunc #2844

Merged
merged 1 commit into from
Nov 24, 2023

Conversation

jordalgo
Copy link
Contributor

@jordalgo jordalgo commented Nov 22, 2023

The 'kfunc' name was in bpftrace first and was "borrowed" by the kernel to now mean something completely different (yet related to bpf). New users going to look for fentry/fexit equivalents in bpftrace are going to be confused that they are called kfunc and kretfunc here. This change just adds fentry/fexit as aliases for kfunc/kretfunc.

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 handle the listing of kfuncs e.g. sudo bpftrace -l | grep kfunc

Comment on lines 60 to 61
- [17. `kfunc`/`kretfunc` (alias: `fentry`/`fexit`): Kernel Functions Tracing](#17-kfunckretfunc-kernel-functions-tracing)
- [18. `kfunc`/`kretfunc` (alias: `fentry`/`fexit`): Kernel Functions Tracing Arguments](#18-kfunckretfunc-kernel-functions-tracing-arguments)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe leave the alias out of the section titles. Cuz we don't do that for the u: and k: stuff either. Also the link seems to be broken

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to make them easier to find but I guess people can always search/find.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I'm hoping to keep the headers terse. Grep will find it anyways

Comment on lines 1790 to 1793
kfunc[:module]:function
kretfunc[:module]:function
fentry[:module]:function
fexit[:module]:function
Copy link
Member

Choose a reason for hiding this comment

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

Super nit: interleave?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean like kfunc/fentry[:module]:function ?

Copy link
Member

Choose a reason for hiding this comment

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

Oh sorry, I meant like:

kfunc[:module]:function
fentry[:module]:function
kretfunc[:module]:function
fexit[:module]:function

src/ast/passes/semantic_analyser.cpp Show resolved Hide resolved
Copy link
Member

@danobi danobi left a comment

Choose a reason for hiding this comment

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

changelog entry would be appropriate I think

The 'kfunc' name was in bpftrace first and was "borrowed" by
the kernel to now mean something completely different
(yet related to bpf). New users going to look for fentry/fexit
equivalents in bpftrace are going to be confused that they are
called kfunc and kretfunc here. This change just adds fentry/fexit
as aliases for kfunc/kretfunc.
@danobi danobi merged commit 4151bab into bpftrace:master Nov 24, 2023
18 checks passed
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.

None yet

3 participants