Messages in this thread | | | Date | Wed, 25 Apr 2012 22:29:22 -0400 | From | Steven Rostedt <> | Subject | [PATCH 0/6][RFC] tracing/kprobes: Get ready for -mfentry |
| |
As I want to add the -mfentry to allow for function tracing without frame pointers (as some distros are now disabling function tracing :-(
I have to handle the case that a kprobe is placed on a ftrace nop. As ftrace nops with -mfentry will be the first instruction of a function, it being the location of a kprobe is a likely occurrence.
Ideally, kprobes would just use the function tracing infrastructure to make an automatic optimized jump. But that is for another day as it requires a bit of work in the function tracer to handle regs and such.
So the quick fix for now is to simply move the probe to the next instruction after the ftrace nop. As the nop shouldn't be doing anything anyway (and tracing should return to the function in the same state) moving the location of the probe should not cause any harm.
The first 5 patches are non controversial, and could probably just be pushed for 3.5 inclusion. The last patch makes the change to move the probe to the next instruction after the ftrace nop.
Anyone see any problem with this?
-- Steve
Steven Rostedt (6): ftrace: Sort all function addresses, not just per page ftrace: Remove extra helper functions ftrace: Speed up search by skipping pages by address ftrace: Consolidate ftrace_location() and ftrace_text_reserved() ftrace: Return record ip addr for ftrace_location() kprobes: Allow probe on ftrace reserved text (but move it)
---- include/asm-generic/vmlinux.lds.h | 2 +- include/linux/ftrace.h | 2 +- kernel/kprobes.c | 11 ++- kernel/trace/ftrace.c | 173 ++++++++++++++++++++----------------- 4 files changed, 104 insertions(+), 84 deletions(-) [unhandled content-type:application/pgp-signature] | |