public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 00/12] kprobes/ftrace: Making ftrace usable for kprobes
@ 2012-06-06  3:50 Steven Rostedt
  2012-06-06  3:50 ` [RFC][PATCH 01/12] ftrace: Pass ftrace_ops as third parameter to function trace callback Steven Rostedt
                   ` (11 more replies)
  0 siblings, 12 replies; 15+ messages in thread
From: Steven Rostedt @ 2012-06-06  3:50 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Masami Hiramatsu, Frederic Weisbecker

This is an RFC of patches that allow ftrace to be used directly by
kprobes.

The first set of patches modify the function tracer to:

 1) have ftrace_ops passed to all functions
 2) allow regs to be passed to all functions when requested

The first change is not required by kprobes, but is a nice feature
that people have asked for. You can now pass data to different
functions. Well, you can pass the ftrace_ops that registered the function
such that if two ftrace_ops register the same callback, the call back
can do different things depending on what registered it.

The second change adds a second mcount trampoline. That is,
if you request to have pt_regs returned, it will call a different
function that saves those registers. If nothing asks for regs, then
the old way is performed, and there's no slow down in the performance,
as not many functions would ever require regs passed to it.

If an arch supports passing of ftrace ops, it must also pass regs.
But it does not need to support passing all (or any) regs. By default
an arch can just pass NULL. If it supports full regs, then
it can allow tools like kprobes to ask for regs. Otherwise regs
is either NULL or a subset of full regs.

The second set is Masami's patches ported on top of these changes.

Note, I just got these working and they could use more comments in
the code. I plan on doing so and cleaning things up, but wanted to
get these out in the "release early, release often" mentality.

-- Steve

These patches are in git and can be found at:

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

Head SHA1: 80a5eca4e5d019c752ba580400f656afc5d8aca6


Masami Hiramatsu (5):
      ftrace: add ftrace_set_filter_ip() for address based filter
      kprobes: cleanup to separate probe-able check
      kprobes: Move locks into appropriate functions
      kprobes: introduce ftrace based optimization
      kprobes/x86: ftrace based optimization for x86

Steven Rostedt (7):
      ftrace: Pass ftrace_ops as third parameter to function trace callback
      ftrace: Consolidate arch dependent functions with 'list' function
      ftrace: Return pt_regs to function trace callback (x86_64 only so far)
      ftrace/x86_32: Push ftrace_ops in as 3rd parameter to function tracer
      ftrace/x86: Add separate function to save regs
      ftrace/x86: Add save_regs for i386 function calls
      kprobes: Inverse taking of module_mutex with kprobe_mutex

----
 arch/x86/include/asm/ftrace.h     |   44 +++---
 arch/x86/include/asm/kprobes.h    |    1 +
 arch/x86/kernel/entry_32.S        |   56 ++++++++
 arch/x86/kernel/entry_64.S        |   73 +++++++++-
 arch/x86/kernel/ftrace.c          |   62 ++++++++-
 arch/x86/kernel/kprobes.c         |   48 +++++++
 include/linux/ftrace.h            |   89 +++++++++++-
 include/linux/kprobes.h           |   27 ++++
 kernel/kprobes.c                  |  250 +++++++++++++++++++++++----------
 kernel/trace/ftrace.c             |  273 ++++++++++++++++++++++++++-----------
 kernel/trace/trace_event_perf.c   |    3 +-
 kernel/trace/trace_events.c       |    3 +-
 kernel/trace/trace_functions.c    |   10 +-
 kernel/trace/trace_irqsoff.c      |    3 +-
 kernel/trace/trace_sched_wakeup.c |    3 +-
 kernel/trace/trace_selftest.c     |   20 ++-
 kernel/trace/trace_stack.c        |    3 +-
 17 files changed, 778 insertions(+), 190 deletions(-)

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

end of thread, other threads:[~2012-06-06 15:18 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-06  3:50 [RFC][PATCH 00/12] kprobes/ftrace: Making ftrace usable for kprobes Steven Rostedt
2012-06-06  3:50 ` [RFC][PATCH 01/12] ftrace: Pass ftrace_ops as third parameter to function trace callback Steven Rostedt
2012-06-06  3:51 ` [RFC][PATCH 02/12] ftrace: Consolidate arch dependent functions with list function Steven Rostedt
2012-06-06  3:51 ` [RFC][PATCH 03/12] ftrace: Return pt_regs to function trace callback (x86_64 only so far) Steven Rostedt
2012-06-06  3:51 ` [RFC][PATCH 04/12] ftrace/x86_32: Push ftrace_ops in as 3rd parameter to function tracer Steven Rostedt
2012-06-06  3:51 ` [RFC][PATCH 05/12] ftrace/x86: Add separate function to save regs Steven Rostedt
2012-06-06  3:51 ` [RFC][PATCH 06/12] ftrace/x86: Add save_regs for i386 function calls Steven Rostedt
2012-06-06 14:37   ` Steven Rostedt
2012-06-06 15:18     ` Masami Hiramatsu
2012-06-06  3:51 ` [RFC][PATCH 07/12] ftrace: add ftrace_set_filter_ip() for address based filter Steven Rostedt
2012-06-06  3:51 ` [RFC][PATCH 08/12] kprobes: Inverse taking of module_mutex with kprobe_mutex Steven Rostedt
2012-06-06  3:51 ` [RFC][PATCH 09/12] kprobes: cleanup to separate probe-able check Steven Rostedt
2012-06-06  3:51 ` [RFC][PATCH 10/12] kprobes: Move locks into appropriate functions Steven Rostedt
2012-06-06  3:51 ` [RFC][PATCH 11/12] kprobes: introduce ftrace based optimization Steven Rostedt
2012-06-06  3:51 ` [RFC][PATCH 12/12] kprobes/x86: ftrace based optimization for x86 Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox