All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 3.0-rc2-tip 0/22]  0: Uprobes patchset with perf probe support
@ 2011-06-07 12:58 ` Srikar Dronamraju
  0 siblings, 0 replies; 244+ messages in thread
From: Srikar Dronamraju @ 2011-06-07 12:58 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar
  Cc: Steven Rostedt, Srikar Dronamraju, Linux-mm,
	Arnaldo Carvalho de Melo, Linus Torvalds, Jonathan Corbet,
	Masami Hiramatsu, Hugh Dickins, Christoph Hellwig,
	Ananth N Mavinakayanahalli, Thomas Gleixner, Andi Kleen,
	Oleg Nesterov, Andrew Morton, Jim Keniston, Roland McGrath, 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 resolves most of the comments on the previous posting
https://lkml.org/lkml/2011/4/1/176 and inputs I got at LFCS.  This
patchset applies on top of tip commit 59c5f46fbe01

Uprobes Patches
This patchset implements inode based uprobes which are specified as
<file>:<offset> where offset is the offset from start of the map.
The probehit overhead is around 3X times the overhead from pid based
patchset.

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-mm "execution out of line (XOL) area". Currently XOL area is
allocated as one page vma.

For previous postings: please refer: http://lkml.org/lkml/2011/3/14/171/
http://lkml.org/lkml/2010/12/16/65 http://lkml.org/lkml/2010/8/25/165
http://lkml.org/lkml/2010/7/27/121 http://lkml.org/lkml/2010/7/12/67
http://lkml.org/lkml/2010/7/8/239 http://lkml.org/lkml/2010/6/29/299
http://lkml.org/lkml/2010/6/14/41 http://lkml.org/lkml/2010/3/20/107 and
http://lkml.org/lkml/2010/5/18/307

This patchset is a rework based on suggestions from discussions on lkml
in September, March and January 2010 (http://lkml.org/lkml/2010/1/11/92,
http://lkml.org/lkml/2010/1/27/19, http://lkml.org/lkml/2010/3/20/107
and http://lkml.org/lkml/2010/3/31/199 ). This implementation of uprobes
doesnt depend on utrace.

Advantages of uprobes over conventional debugging include:

1. Non-disruptive.
Unlike current ptrace based mechanisms, uprobes tracing wouldnt
involve signals, stopping threads and context switching between the
tracer and tracee.

2. Much better handling of multithreaded programs because of XOL.
Current ptrace based mechanisms use single stepping inline, i.e they
copy back the original instruction on hitting a breakpoint.  In such
mechanisms tracers have to stop all the threads on a breakpoint hit or
tracers will not be able to handle all hits to the location of
interest. Uprobes uses execution out of line, where the instruction to
be traced is analysed at the time of breakpoint insertion and a copy
of instruction is stored at a different location.  On breakpoint hit,
uprobes jumps to that copied location and singlesteps the same
instruction and does the necessary fixups post singlestepping.

3. Multiple tracers for an application.
Multiple uprobes based tracer could work in unison to trace an
application. There could one tracer that could be interested in
generic events for a particular set of process. While there could be
another tracer that is just interested in one specific event of a
particular process thats part of the previous set of process.

4. Corelating events from kernels and userspace.
Uprobes could be used with other tools like kprobes, tracepoints or as
part of higher level tools like perf to give a consolidated set of
events from kernel and userspace.  In future we could look at a single
backtrace showing application, library and kernel calls.

Here is the list of TODO Items.

- Breakpoint handling should co-exist with singlestep/blockstep from
  another tracer/debugger.
- Queue and dequeue signals delivered from the singlestep till
  completion of postprocessing.
- Prefiltering (i.e filtering at the time of probe insertion)
- Return probes.
- Support for other architectures.
- Uprobes booster.
- replace macro W with bits in inat table.

To try please fetch using
git fetch \
git://git.kernel.org/pub/scm/linux/kernel/git/srikar/linux-uprobes.git \
tip_inode_uprobes_070611:tip_inode_uprobes

Please refer "[RFC] [PATCH 3.0-rc2-tip 18/22] tracing: tracing: Uprobe
tracer documentation" on how to use uprobe_tracer.

Please refer "[RFC] [PATCH 3.0-rc2-tip 22/22] perf: Documentation for perf
uprobes" on how to use uprobe_tracer.

Please do provide your valuable comments.

Thanks in advance.
Srikar

Srikar Dronamraju (22)
 0: Uprobes patchset with perf probe support
 1: X86 specific breakpoint definitions.
 2: uprobes: Breakground page replacement.
 3: uprobes: Adding and remove a uprobe in a rb tree.
 4: Uprobes: register/unregister probes.
 5: x86: analyze instruction and determine fixups.
 6: uprobes: store/restore original instruction.
 7: uprobes: mmap and fork hooks.
 8: x86: architecture specific task information.
 9: uprobes: task specific information.
10: uprobes: slot allocation for uprobes
11: uprobes: get the breakpoint address.
12: x86: x86 specific probe handling
13: uprobes: Handing int3 and singlestep exception.
14: x86: uprobes exception notifier for x86.
15: uprobes: register a notifier for uprobes.
16: tracing: Extract out common code for kprobes/uprobes traceevents.
17: tracing: uprobes trace_event interface
18: tracing: Uprobe tracer documentation
19: perf: rename target_module to target
20: perf: perf interface for uprobes
21: perf: show possible probes in a given executable file or library.
22: perf: Documentation for perf uprobes


 Documentation/trace/uprobetrace.txt     |   94 ++
 arch/Kconfig                            |    4 +
 arch/x86/Kconfig                        |    3 +
 arch/x86/include/asm/thread_info.h      |    2 +
 arch/x86/include/asm/uprobes.h          |   53 ++
 arch/x86/kernel/Makefile                |    1 +
 arch/x86/kernel/signal.c                |   14 +
 arch/x86/kernel/uprobes.c               |  591 +++++++++++++
 include/linux/mm_types.h                |    9 +
 include/linux/sched.h                   |    9 +-
 include/linux/uprobes.h                 |  194 ++++
 kernel/Makefile                         |    1 +
 kernel/fork.c                           |   10 +
 kernel/trace/Kconfig                    |   20 +
 kernel/trace/Makefile                   |    2 +
 kernel/trace/trace.h                    |    5 +
 kernel/trace/trace_kprobe.c             |  860 +------------------
 kernel/trace/trace_probe.c              |  752 ++++++++++++++++
 kernel/trace/trace_probe.h              |  160 ++++
 kernel/trace/trace_uprobe.c             |  812 +++++++++++++++++
 kernel/uprobes.c                        | 1476 +++++++++++++++++++++++++++++++
 mm/mmap.c                               |    6 +
 tools/perf/Documentation/perf-probe.txt |   21 +-
 tools/perf/builtin-probe.c              |   77 ++-
 tools/perf/util/probe-event.c           |  431 ++++++++--
 tools/perf/util/probe-event.h           |   12 +-
 tools/perf/util/symbol.c                |   10 +-
 tools/perf/util/symbol.h                |    1 +
 28 files changed, 4686 insertions(+), 944 deletions(-)

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

end of thread, other threads:[~2011-07-25 12:29 UTC | newest]

Thread overview: 244+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-07 12:58 [PATCH v4 3.0-rc2-tip 0/22] 0: Uprobes patchset with perf probe support Srikar Dronamraju
2011-06-07 12:58 ` Srikar Dronamraju
2011-06-07 12:58 ` [PATCH v4 3.0-rc2-tip 1/22] 1: X86 specific breakpoint definitions Srikar Dronamraju
2011-06-07 12:58   ` Srikar Dronamraju
2011-06-07 12:58 ` [PATCH v4 3.0-rc2-tip 2/22] 2: uprobes: Breakground page replacement Srikar Dronamraju
2011-06-07 12:58   ` Srikar Dronamraju
2011-06-09 23:03   ` Peter Zijlstra
2011-06-09 23:03     ` Peter Zijlstra
2011-06-13  8:48     ` Srikar Dronamraju
2011-06-13  8:48       ` Srikar Dronamraju
2011-06-09 23:03   ` Peter Zijlstra
2011-06-09 23:03     ` Peter Zijlstra
2011-06-13  8:50     ` Srikar Dronamraju
2011-06-13  8:50       ` Srikar Dronamraju
2011-06-09 23:03   ` Peter Zijlstra
2011-06-09 23:03     ` Peter Zijlstra
2011-06-09 23:03   ` Peter Zijlstra
2011-06-09 23:03     ` Peter Zijlstra
2011-06-13  8:59     ` Srikar Dronamraju
2011-06-13  8:59       ` Srikar Dronamraju
2011-06-14 12:57       ` Peter Zijlstra
2011-06-14 12:57         ` Peter Zijlstra
2011-06-14 14:57         ` Srikar Dronamraju
2011-06-14 14:57           ` Srikar Dronamraju
2011-06-09 23:03   ` Peter Zijlstra
2011-06-09 23:03     ` Peter Zijlstra
2011-06-13  9:14     ` Srikar Dronamraju
2011-06-13  9:14       ` Srikar Dronamraju
2011-06-13 13:46   ` Oleg Nesterov
2011-06-13 13:46     ` Oleg Nesterov
2011-06-13 17:00   ` Oleg Nesterov
2011-06-13 17:00     ` Oleg Nesterov
2011-06-14 12:35     ` Srikar Dronamraju
2011-06-14 12:35       ` Srikar Dronamraju
2011-06-14 14:20       ` Oleg Nesterov
2011-06-14 14:20         ` Oleg Nesterov
2011-06-15  8:55         ` Srikar Dronamraju
2011-06-15  8:55           ` Srikar Dronamraju
2011-06-15 17:54           ` Oleg Nesterov
2011-06-15 17:54             ` Oleg Nesterov
2011-06-14 13:01     ` Peter Zijlstra
2011-06-14 13:01       ` Peter Zijlstra
2011-06-14 14:27       ` Oleg Nesterov
2011-06-14 14:27         ` Oleg Nesterov
2011-06-14 15:07         ` Peter Zijlstra
2011-06-14 15:07           ` Peter Zijlstra
2011-06-14 15:40           ` Oleg Nesterov
2011-06-14 15:40             ` Oleg Nesterov
2011-06-14 18:22             ` Peter Zijlstra
2011-06-14 18:22               ` Peter Zijlstra
2011-06-16 12:48   ` Peter Zijlstra
2011-06-16 12:48     ` Peter Zijlstra
2011-06-07 12:58 ` [PATCH v4 3.0-rc2-tip 3/22] 3: uprobes: Adding and remove a uprobe in a rb tree Srikar Dronamraju
2011-06-07 12:58   ` Srikar Dronamraju
2011-06-08  4:12   ` Stephen Wilson
2011-06-08  4:12     ` Stephen Wilson
2011-06-08  7:04     ` Josh Stone
2011-06-08  7:04       ` Josh Stone
2011-06-08 10:29       ` Srikar Dronamraju
2011-06-08 10:29         ` Srikar Dronamraju
2011-06-08 10:30   ` Srikar Dronamraju
2011-06-08 10:30     ` Srikar Dronamraju
2011-06-07 12:59 ` [PATCH v4 3.0-rc2-tip 4/22] 4: Uprobes: register/unregister probes Srikar Dronamraju
2011-06-07 12:59   ` Srikar Dronamraju
2011-06-08 22:10   ` Stephen Wilson
2011-06-08 22:10     ` Stephen Wilson
2011-06-09  5:43     ` Srikar Dronamraju
2011-06-09  5:43       ` Srikar Dronamraju
2011-06-09 23:03   ` Peter Zijlstra
2011-06-09 23:03     ` Peter Zijlstra
2011-06-16  5:40     ` Srikar Dronamraju
2011-06-16  5:40       ` Srikar Dronamraju
2011-06-09 23:03   ` Peter Zijlstra
2011-06-09 23:03     ` Peter Zijlstra
2011-06-13 16:50     ` Steven Rostedt
2011-06-13 16:50       ` Steven Rostedt
2011-06-16  5:26     ` Srikar Dronamraju
2011-06-16  5:26       ` Srikar Dronamraju
2011-06-16  9:42       ` Peter Zijlstra
2011-06-16  9:42         ` Peter Zijlstra
2011-06-13 19:57   ` Oleg Nesterov
2011-06-13 19:57     ` Oleg Nesterov
2011-06-14 12:00     ` Srikar Dronamraju
2011-06-14 12:00       ` Srikar Dronamraju
2011-06-14 14:29       ` Oleg Nesterov
2011-06-14 14:29         ` Oleg Nesterov
2011-06-15 17:30   ` Oleg Nesterov
2011-06-15 17:30     ` Oleg Nesterov
2011-06-16  5:09     ` Srikar Dronamraju
2011-06-16  5:09       ` Srikar Dronamraju
2011-06-15 17:41   ` Peter Zijlstra
2011-06-15 17:41     ` Peter Zijlstra
2011-06-16  4:11     ` Srikar Dronamraju
2011-06-16  4:11       ` Srikar Dronamraju
2011-06-16  9:46       ` Peter Zijlstra
2011-06-16  9:46         ` Peter Zijlstra
2011-06-16  9:54         ` Srikar Dronamraju
2011-06-16  9:54           ` Srikar Dronamraju
2011-06-16 10:09           ` Peter Zijlstra
2011-06-16 10:09             ` Peter Zijlstra
2011-06-16 13:51           ` Oleg Nesterov
2011-06-16 13:51             ` Oleg Nesterov
2011-06-17  9:29             ` Srikar Dronamraju
2011-06-17  9:29               ` Srikar Dronamraju
2011-06-15 18:01   ` Peter Zijlstra
2011-06-15 18:01     ` Peter Zijlstra
2011-07-24 18:07   ` Oleg Nesterov
2011-07-24 18:07     ` Oleg Nesterov
2011-07-25 12:17     ` Srikar Dronamraju
2011-07-25 12:17       ` Srikar Dronamraju
2011-06-07 12:59 ` [PATCH v4 3.0-rc2-tip 5/22] 5: x86: analyze instruction and determine fixups Srikar Dronamraju
2011-06-07 12:59   ` Srikar Dronamraju
2011-06-09 23:03   ` Peter Zijlstra
2011-06-09 23:03     ` Peter Zijlstra
2011-06-07 12:59 ` [PATCH v4 3.0-rc2-tip 6/22] 6: uprobes: store/restore original instruction Srikar Dronamraju
2011-06-07 12:59   ` Srikar Dronamraju
2011-06-07 12:59 ` [PATCH v4 3.0-rc2-tip 7/22] 7: uprobes: mmap and fork hooks Srikar Dronamraju
2011-06-07 12:59   ` Srikar Dronamraju
2011-06-08 22:12   ` Stephen Wilson
2011-06-08 22:12     ` Stephen Wilson
2011-06-09  5:50     ` Srikar Dronamraju
2011-06-09  5:50       ` Srikar Dronamraju
2011-06-15 18:11   ` Peter Zijlstra
2011-06-15 18:11     ` Peter Zijlstra
2011-06-16  3:26     ` Srikar Dronamraju
2011-06-16  3:26       ` Srikar Dronamraju
2011-06-16 12:00       ` Peter Zijlstra
2011-06-16 12:00         ` Peter Zijlstra
2011-06-16 13:00         ` Srikar Dronamraju
2011-06-16 13:00           ` Srikar Dronamraju
2011-06-16 18:23           ` Peter Zijlstra
2011-06-16 18:23             ` Peter Zijlstra
2011-06-16 18:25             ` Peter Zijlstra
2011-06-16 18:25               ` Peter Zijlstra
2011-06-17  4:50             ` Srikar Dronamraju
2011-06-17  4:50               ` Srikar Dronamraju
2011-06-17  8:03               ` Peter Zijlstra
2011-06-17  8:03                 ` Peter Zijlstra
2011-06-17  9:05                 ` Srikar Dronamraju
2011-06-17  9:05                   ` Srikar Dronamraju
2011-06-17  9:41                   ` Peter Zijlstra
2011-06-17  9:41                     ` Peter Zijlstra
2011-06-21 13:17                     ` Peter Zijlstra
2011-06-21 13:17                       ` Peter Zijlstra
2011-06-22 14:39                       ` Srikar Dronamraju
2011-06-22 14:39                         ` Srikar Dronamraju
2011-06-24  2:06                         ` Srikar Dronamraju
2011-06-24  2:06                           ` Srikar Dronamraju
2011-06-24  7:42                           ` Peter Zijlstra
2011-06-24  7:42                             ` Peter Zijlstra
2011-06-27  6:45                             ` Srikar Dronamraju
2011-06-27  6:45                               ` Srikar Dronamraju
2011-06-27  8:57                               ` Peter Zijlstra
2011-06-27  8:57                                 ` Peter Zijlstra
2011-07-18  9:20                                 ` Srikar Dronamraju
2011-07-18  9:20                                   ` Srikar Dronamraju
2011-07-18 14:31                                   ` Peter Zijlstra
2011-07-18 14:31                                     ` Peter Zijlstra
2011-07-19  6:53                                     ` Srikar Dronamraju
2011-07-19  6:53                                       ` Srikar Dronamraju
2011-07-20 11:56                                       ` Peter Zijlstra
2011-07-20 11:56                                         ` Peter Zijlstra
2011-06-07 12:59 ` [PATCH v4 3.0-rc2-tip 8/22] 8: x86: architecture specific task information Srikar Dronamraju
2011-06-07 12:59   ` Srikar Dronamraju
2011-06-07 12:59 ` [PATCH v4 3.0-rc2-tip 9/22] 9: uprobes: task specific information Srikar Dronamraju
2011-06-07 12:59   ` Srikar Dronamraju
2011-06-07 13:00 ` [PATCH v4 3.0-rc2-tip 10/22] 10: uprobes: slot allocation for uprobes Srikar Dronamraju
2011-06-07 13:00   ` Srikar Dronamraju
2011-06-07 13:00 ` [PATCH v4 3.0-rc2-tip 11/22] 11: uprobes: get the breakpoint address Srikar Dronamraju
2011-06-07 13:00   ` Srikar Dronamraju
2011-06-07 13:00 ` [PATCH v4 3.0-rc2-tip 12/22] 12: x86: x86 specific probe handling Srikar Dronamraju
2011-06-07 13:00   ` Srikar Dronamraju
2011-06-07 13:00 ` [PATCH v4 3.0-rc2-tip 13/22] 13: uprobes: Handing int3 and singlestep exception Srikar Dronamraju
2011-06-07 13:00   ` Srikar Dronamraju
2011-06-08 22:11   ` Stephen Wilson
2011-06-08 22:11     ` Stephen Wilson
2011-06-09  5:47     ` Srikar Dronamraju
2011-06-09  5:47       ` Srikar Dronamraju
2011-06-16 11:52   ` Peter Zijlstra
2011-06-16 11:52     ` Peter Zijlstra
2011-06-16 12:04     ` Srikar Dronamraju
2011-06-16 12:04       ` Srikar Dronamraju
2011-06-16 12:35       ` Peter Zijlstra
2011-06-16 12:35         ` Peter Zijlstra
2011-06-07 13:01 ` [PATCH v4 3.0-rc2-tip 14/22] 14: x86: uprobes exception notifier for x86 Srikar Dronamraju
2011-06-07 13:01   ` Srikar Dronamraju
2011-06-21 13:31   ` Peter Zijlstra
2011-06-21 13:31     ` Peter Zijlstra
2011-06-21 13:32     ` Peter Zijlstra
2011-06-21 13:32       ` Peter Zijlstra
2011-06-22 14:54       ` Srikar Dronamraju
2011-06-22 14:54         ` Srikar Dronamraju
2011-06-22 16:40         ` Roland McGrath
2011-06-22 16:40           ` Roland McGrath
2011-06-07 13:01 ` [PATCH v4 3.0-rc2-tip 15/22] 15: uprobes: register a notifier for uprobes Srikar Dronamraju
2011-06-07 13:01   ` Srikar Dronamraju
2011-06-07 13:01 ` [PATCH v4 3.0-rc2-tip 16/22] 16: tracing: Extract out common code for kprobes/uprobes traceevents Srikar Dronamraju
2011-06-07 13:01   ` Srikar Dronamraju
2011-06-07 13:01 ` [PATCH v4 3.0-rc2-tip 17/22] 17: tracing: uprobes trace_event interface Srikar Dronamraju
2011-06-07 13:01   ` Srikar Dronamraju
2011-06-07 13:01 ` [PATCH v4 3.0-rc2-tip 18/22] 18: tracing: Uprobe tracer documentation Srikar Dronamraju
2011-06-07 13:01   ` Srikar Dronamraju
2011-06-07 13:02 ` [PATCH v4 3.0-rc2-tip 19/22] 19: perf: rename target_module to target Srikar Dronamraju
2011-06-07 13:02   ` Srikar Dronamraju
2011-06-07 13:02 ` [PATCH v4 3.0-rc2-tip 20/22] 20: perf: perf interface for uprobes Srikar Dronamraju
2011-06-07 13:02   ` Srikar Dronamraju
2011-06-07 13:30   ` Christoph Hellwig
2011-06-07 13:30     ` Christoph Hellwig
2011-06-07 13:38     ` Ananth N Mavinakayanahalli
2011-06-07 13:38       ` Ananth N Mavinakayanahalli
2011-06-07 14:21       ` Arnaldo Carvalho de Melo
2011-06-07 14:21         ` Arnaldo Carvalho de Melo
2011-06-07 16:06         ` Srikar Dronamraju
2011-06-07 16:06           ` Srikar Dronamraju
2011-06-08  3:41       ` Masami Hiramatsu
2011-06-08  3:41         ` Masami Hiramatsu
2011-06-07 19:59   ` Josh Stone
2011-06-07 19:59     ` Josh Stone
2011-06-08  3:44     ` Srikar Dronamraju
2011-06-08  3:44       ` Srikar Dronamraju
2011-06-10 11:50   ` Masami Hiramatsu
2011-06-10 11:50     ` Masami Hiramatsu
2011-06-13  8:41     ` Srikar Dronamraju
2011-06-14  6:29       ` Masami Hiramatsu
2011-06-14 11:56         ` Srikar Dronamraju
2011-06-16  5:59           ` Masami Hiramatsu
2011-06-07 13:02 ` [PATCH v4 3.0-rc2-tip 21/22] 21: perf: show possible probes in a given executable file or library Srikar Dronamraju
2011-06-07 13:02   ` Srikar Dronamraju
2011-06-07 13:02 ` [PATCH v4 3.0-rc2-tip 22/22] 22: perf: Documentation for perf uprobes Srikar Dronamraju
2011-06-07 13:02   ` Srikar Dronamraju
2011-06-10 12:03   ` Masami Hiramatsu
2011-06-10 12:03     ` Masami Hiramatsu
2011-06-09 18:42 ` [PATCH v4 3.0-rc2-tip 0/22] 0: Uprobes patchset with perf probe support Peter Zijlstra
2011-06-09 18:42   ` Peter Zijlstra
2011-06-10  5:56   ` Ananth N Mavinakayanahalli
2011-06-10  5:56     ` Ananth N Mavinakayanahalli
2011-06-13  9:23   ` Srikar Dronamraju
2011-06-13  9:23     ` Srikar Dronamraju
2011-06-09 23:03 ` Peter Zijlstra
2011-06-09 23:03   ` Peter Zijlstra
2011-06-10  6:15   ` Masami Hiramatsu
2011-06-10  6:15     ` Masami Hiramatsu
2011-06-13 10:08   ` Srikar Dronamraju
2011-06-13 10:08     ` 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.