Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kernel added new probe called trampoline allowing to probe almost any kernel function when BTF info is available in the system. Adding the interface to define trampoline function for given kernel function via BPF_PROG macro, like: KFUNC_PROBE(do_sys_open, int dfd, const char *filename, int flags, int mode) { ... } which defines trampoline function with the 'kfunc__do_sys_open' name, that instruments do_sys_open kernel function before the function is executed. or: KRETFUNC_PROBE(do_sys_open, int dfd, const char *filename, int flags, int mode, int ret) { ... } which defines trampoline function with the 'kfunc__do_sys_open' name, that instruments do_sys_open kernel function after the function is executed. The main benefit is really lower overhead for trampolines (please see following commit for klockstat.py with perf comparison). Another benefit is the ability of kretfunc probe to access function arguments, so some tools might need only one program instead of entry/exit ones (please see following commit for opensnoop.py changes). Currently the interface does not allow to define function of different name than: kfunc__<function_name> or kretfunc__<function_name> which is sufficient by now, and can be easily changed in future if needed. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
- Loading branch information
1 parent
550706a
commit 572478b
Showing
5 changed files
with
194 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters