All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/10] Uprobes patches.
@ 2010-03-20 14:24 Srikar Dronamraju
  2010-03-20 14:25 ` [PATCH v1 1/10] Move Macro W to insn.h Srikar Dronamraju
                   ` (10 more replies)
  0 siblings, 11 replies; 38+ messages in thread
From: Srikar Dronamraju @ 2010-03-20 14:24 UTC (permalink / raw)
  To: Peter Zijlstra, Andrew Morton, Ingo Molnar, Linus Torvalds
  Cc: Masami Hiramatsu, Mel Gorman, Srikar Dronamraju,
	Ananth N Mavinakayanahalli, Jim Keniston, Frederic Weisbecker,
	Frank Ch. Eigler, LKML


This patchset implements Uprobes which enables you to dynamically break
into any routine in a user space application and collect information
non-disruptively.

This patchset is a rework based on suggestions from discussions on lkml
in January this year (http://lkml.org/lkml/2010/1/11/92 and
http://lkml.org/lkml/2010/1/27/19).  This implementation of uprobes
doesnt depend on utrace.

When a uprobe is registered, Uprobes makes a copy of the probed
instruction, replaces the first byte(s) of the probed instruction with a
breakpoint instruction. (Uprobes uses background page replacement
mechanism and ensures that the breakpoint affects only that process.)

When a CPU hits the breakpoint instruction, Uprobes gets notified of
trap and finds the associated uprobe. It then executes the associated
handler. Uprobes single-steps its copy of the probed instruction and
resumes execution of the probed process at the instruction following the
probepoint. Instruction copies to be single-stepped are stored in a
per-process "execution out of line (XOL) area". Currently XOL area is
allocated as one page vma.

Advantages of uprobes over conventional debugging include:
1. Non-disruptive.
2. Much better handling of multithreaded programs because of XOL.
3. No context switch between tracer, tracee.
4. Allows multiple processes to trace same tracee.

Here is the list of TODO Items.

- Provide a perf interface to uprobes. (coming in next version)
- Allowing probes across fork/exec.
- Allowing probes on per-executable/per dso.
- Allow multiple probes to share a probepoint.
- Support for other architectures.
- Return probes.
- Uprobes booster.

This patchset is based on 2.6.34-rc2.

Please do provide your valuable comments.

Thanks in advance.
Srikar


Srikar Dronamraju (10):
 1.  X86 instruction analysis: Move Macro W to insn.h
 2.  mm: Move replace_page() to mm/memory.c
 3.  mm: Enhance replace_page() to support pagecache
 4.  user_bkpt: User Space Breakpoint Assistance Layer
 5.  user_bkpt: X86 details for User space breakpoint assistance
 6.  user_bkpt: Slot allocation for Execution out of line
 7.  uprobes: Uprobes Implementation
 8.  uprobes: X86 details for Uprobes
 9.  uprobes: Uprobes Documentation patch
 10. samples: Uprobes samples

 Documentation/uprobes.txt        |  244 ++++++++++++
 arch/Kconfig                     |   31 ++
 arch/x86/Kconfig                 |    2 +
 arch/x86/include/asm/insn.h      |    7 +
 arch/x86/include/asm/user_bkpt.h |   43 ++
 arch/x86/kernel/Makefile         |    3 +
 arch/x86/kernel/kprobes.c        |    7 -
 arch/x86/kernel/uprobes.c        |   87 ++++
 arch/x86/kernel/user_bkpt.c      |  574 +++++++++++++++++++++++++++
 include/linux/mm.h               |    2 +
 include/linux/sched.h            |    3 +
 include/linux/tracehook.h        |   18 +
 include/linux/uprobes.h          |  178 +++++++++
 include/linux/user_bkpt.h        |  296 ++++++++++++++
 include/linux/user_bkpt_xol.h    |   61 +++
 kernel/Makefile                  |    3 +
 kernel/fork.c                    |    3 +
 kernel/uprobes.c                 |  798 ++++++++++++++++++++++++++++++++++++++
 kernel/user_bkpt.c               |  572 +++++++++++++++++++++++++++
 kernel/user_bkpt_xol.c           |  290 ++++++++++++++
 mm/ksm.c                         |   59 ---
 mm/memory.c                      |   62 +++
 samples/Kconfig                  |    7 +
 samples/uprobes/Makefile         |   17 +
 samples/uprobes/uprobe_example.c |   83 ++++
 25 files changed, 3384 insertions(+), 66 deletions(-)
---

 0 files changed, 0 insertions(+), 0 deletions(-)



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

end of thread, other threads:[~2010-03-25  8:51 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-20 14:24 [PATCH v1 0/10] Uprobes patches Srikar Dronamraju
2010-03-20 14:25 ` [PATCH v1 1/10] Move Macro W to insn.h Srikar Dronamraju
2010-03-20 15:50   ` Masami Hiramatsu
2010-03-22  6:24     ` Srikar Dronamraju
2010-03-22 14:11       ` Masami Hiramatsu
2010-03-20 14:25 ` [PATCH v1 2/10] Move replace_page() to mm/memory.c Srikar Dronamraju
2010-03-20 14:25 ` [PATCH v1 3/10] Enhance replace_page() to support pagecache Srikar Dronamraju
2010-03-20 14:25 ` [PATCH v1 4/10] User Space Breakpoint Assistance Layer Srikar Dronamraju
2010-03-23  1:40   ` Andrew Morton
2010-03-23  4:48     ` Randy Dunlap
2010-03-23 11:26     ` Srikar Dronamraju
2010-03-20 14:25 ` [PATCH v1 5/10] X86 details for user space breakpoint assistance Srikar Dronamraju
2010-03-20 14:26 ` [PATCH v1 6/10] Slot allocation for Execution out of line Srikar Dronamraju
2010-03-20 14:26 ` [PATCH v1 7/10] Uprobes Implementation Srikar Dronamraju
2010-03-23 11:01   ` Peter Zijlstra
2010-03-23 11:04     ` Peter Zijlstra
2010-03-23 12:23     ` Srikar Dronamraju
2010-03-23 13:46       ` Peter Zijlstra
2010-03-23 14:20         ` Masami Hiramatsu
2010-03-23 15:15           ` Peter Zijlstra
2010-03-23 17:36             ` Masami Hiramatsu
2010-03-24 10:22           ` Srikar Dronamraju
2010-03-23 15:05         ` Ananth N Mavinakayanahalli
2010-03-23 15:15           ` Peter Zijlstra
2010-03-23 15:26             ` Frank Ch. Eigler
2010-03-24  5:59             ` Ananth N Mavinakayanahalli
2010-03-24  7:58         ` Srikar Dronamraju
2010-03-24 13:00           ` Peter Zijlstra
2010-03-25  7:56             ` Srikar Dronamraju
2010-03-25  8:41             ` Srikar Dronamraju
2010-03-20 14:26 ` [PATCH v1 8/10] X86 details for uprobes Srikar Dronamraju
2010-03-20 14:26 ` [PATCH v1 9/10] Uprobes Documentation patch Srikar Dronamraju
2010-03-22  3:00   ` Randy Dunlap
2010-03-22  5:34     ` Srikar Dronamraju
2010-03-22 14:51       ` Randy Dunlap
2010-03-20 14:26 ` [PATCH v1 10/10] Uprobes samples Srikar Dronamraju
2010-03-23  1:38 ` [PATCH v1 0/10] Uprobes patches Andrew Morton
2010-03-23 10:55   ` Srikar Dronamraju

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.