All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5][RFC] kprobes/ftrace: Have kprobes use ftrace on ftrace nops
@ 2011-08-10 16:22 Steven Rostedt
  2011-08-10 16:22 ` [PATCH 1/5][RFC] tracing: Clean up tb_fmt to not give faulty compile warning Steven Rostedt
                   ` (5 more replies)
  0 siblings, 6 replies; 28+ messages in thread
From: Steven Rostedt @ 2011-08-10 16:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Thomas Gleixner, Peter Zijlstra,
	Frederic Weisbecker, Masami Hiramatsu, Arnaldo Carvalho de Melo,
	Jason Baron

Hi All,

I started working on adding the -mfentry switch to ftrace, which
allows us to remove the frame pointers requirement from function tracing
as well as makes mcount (fentry) work just better.

But when I did this in another branch, I noticed that I broke kprobes
in its most common usage. The attaching a probe at the beginning of
a function to use get to its parameters.

So I started this branch. This branch is to have kprobes use ftrace
directly when a probe is attached to a ftrace nop. Currently, kprobes
will just error when that happens. With this patch set, it will hook
into the ftrace infrastructure and use ftrace instead. This is more
like an optimized probe as no breakpoints need to be set. A call to
the function is done directly via the mcount trampoline. If ftrace
pt_regs is implemented for an arch, kprobes gets this feature for free.

The first patch is just a clean up that I need to push out to get rid
of the annoying compile warning about initialized variables that
gcc can't tell have been initialized.

The next two patches have ftrace pass both the ftrace_ops structure
and the pt_regs to the callback function that is registered with ftrace.

The last two patches have kprobes interact with ftrace and use the
ftrace infrastructure instead.

I only did this for x86_64, and will do it for x86_32 and PPC64 if everyone
agrees with this approach. Then I could find people to do it for other
archs :)

Thanks!

-- Steve

This patch set can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
rfc/kprobes/ftrace

Head SHA1: e704df971bc958c789e9dcf0b453e4c02e27887b


Steven Rostedt (5):
      tracing: Clean up tb_fmt to not give faulty compile warning
      ftrace: Pass ftrace_ops as third parameter to function trace callback
      ftrace: Return pt_regs to function trace callback (x86_64 only so far)
      kprobes: Inverse taking of module_mutex with kprobe_mutex
      kprobes: Use ftrace hooks when probing ftrace nops

----
 arch/x86/include/asm/ftrace.h     |   42 ++++++----
 arch/x86/kernel/entry_64.S        |   24 +++++-
 include/linux/ftrace.h            |   27 ++++++-
 include/linux/kprobes.h           |    6 ++
 kernel/kprobes.c                  |  167 ++++++++++++++++++++++++++++++++++---
 kernel/trace/ftrace.c             |   74 +++++++++++------
 kernel/trace/trace_events.c       |    3 +-
 kernel/trace/trace_functions.c    |   10 ++-
 kernel/trace/trace_irqsoff.c      |    3 +-
 kernel/trace/trace_printk.c       |   19 ++--
 kernel/trace/trace_sched_wakeup.c |    3 +-
 kernel/trace/trace_selftest.c     |   20 ++++-
 kernel/trace/trace_stack.c        |    3 +-
 13 files changed, 323 insertions(+), 78 deletions(-)

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2011-08-19  2:42 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-10 16:22 [PATCH 0/5][RFC] kprobes/ftrace: Have kprobes use ftrace on ftrace nops Steven Rostedt
2011-08-10 16:22 ` [PATCH 1/5][RFC] tracing: Clean up tb_fmt to not give faulty compile warning Steven Rostedt
2011-08-10 16:22 ` [PATCH 2/5][RFC] ftrace: Pass ftrace_ops as third parameter to function trace Steven Rostedt
2011-08-10 16:22 ` [PATCH 3/5][RFC] ftrace: Return pt_regs to function trace callback (x86_64 only so Steven Rostedt
2011-08-11  5:55   ` Masami Hiramatsu
2011-08-11 12:59     ` Steven Rostedt
2011-08-12  0:55       ` Masami Hiramatsu
2011-08-12 13:05         ` Steven Rostedt
2011-08-10 16:22 ` [PATCH 4/5][RFC] kprobes: Inverse taking of module_mutex with kprobe_mutex Steven Rostedt
2011-08-10 16:22 ` [PATCH 5/5][RFC] kprobes: Use ftrace hooks when probing ftrace nops Steven Rostedt
2011-08-11  7:41   ` Masami Hiramatsu
2011-08-11 13:22     ` Steven Rostedt
2011-08-12  2:41       ` Masami Hiramatsu
2011-08-12  5:46       ` Ananth N Mavinakayanahalli
2011-08-12 13:14         ` Steven Rostedt
2011-08-11  0:21 ` [PATCH 0/5][RFC] kprobes/ftrace: Have kprobes use ftrace on " Masami Hiramatsu
2011-08-11  0:34   ` Steven Rostedt
2011-08-11  6:28     ` Masami Hiramatsu
2011-08-11 13:01       ` Steven Rostedt
2011-08-12  2:57         ` Masami Hiramatsu
2011-08-12 13:08           ` Steven Rostedt
2011-08-13 10:09             ` Masami Hiramatsu
2011-08-14  2:58               ` Steven Rostedt
2011-08-14 10:28                 ` Masami Hiramatsu
2011-08-15 13:06                   ` Steven Rostedt
2011-08-17 12:12                     ` Masami Hiramatsu
2011-08-18 20:06                       ` Steven Rostedt
2011-08-19  2:41                         ` Masami Hiramatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.