All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -tip v3&10 00/18] perf-probe updates - optprobe, elfutils and lazy matching
@ 2010-02-25 13:33 Masami Hiramatsu
  2010-02-25 13:33 ` [PATCH -tip v3&10 01/18] kprobes/x86: Cleanup RELATIVEJUMP_INSTRUCTION to RELATIVEJUMP_OPCODE Masami Hiramatsu
                   ` (17 more replies)
  0 siblings, 18 replies; 47+ messages in thread
From: Masami Hiramatsu @ 2010-02-25 13:33 UTC (permalink / raw)
  To: Ingo Molnar, Frederic Weisbecker, Ananth N Mavinakayanahalli, lkml
  Cc: systemtap, DLE

Hi,

Here are several bugfixes and updates for perf-probe/kprobes.
This updates includes moving onto elfutils-libdw and
the lazy line matching support.
This version also includes the patchset of the kprobes jump
optimization so that we can ensure the 'perf-probe' will utilize
it by default. :)
This version changes nothing but merging previous two patch-sets and
updating against 2.6.33-tip.

- elfutils library is developed closely with gcc team,
  and it is simple and fast dwarf analysis library.

- lazy-matching is similar to glob matching but ignoring
  spaces in both of target and pattern.

- Kprobes jump optimization allows kprobes to replace breakpoint
  with a jump instruction for reducing probing overhead drastically.
  (See Documentation/kprobes.txt for details)

This is updated todo list. Most of them are related
to the 'type' support.

TODO:
  - Enhance probe-finder to decode call frame instructions.
  - Support sys_perf_counter_open (for non-root users)
  - Support tracing static variables (non global)
  - Support variable types from debuginfo (e.g. char, int, ...)
  - Support fields of data structures (var->field)
  - Support array (var[N])
  - Support dynamic array-indexing (var[var2])
  - Support string/dynamic arrays (*var, var[N..M])
  - Support force type-casting ((type)var)
  - Support the type of return value
  - More debugger like enhancements(%next, --disasm, etc.)
  - Better support for probes on modules
  - --list option shows the file-name/line-number of each events.
  - Support kprobes optimization on preemptive kernel.


How to check jump optimization
==============================
The jump replacement optimization is transparently and automatically
done in kprobes.
So, if you enables CONFIG_KPROBE_EVENT(a.k.a. kprobe-tracer) in
kernel config, all kprobes users including 'perf probe' can benefit
from this feature.

e.g.

 # perf probe schedule
Added new event:
  probe:schedule                           (on schedule+0)

You can now use it on all perf tools, such as:

        perf record -e probe:schedule -a sleep 1

 # cat /sys/kernel/debug/kprobes/list
 c069ce4c  k  schedule+0x0    [DISABLED]

 # echo 1 > /sys/kernel/debug/tracing/events/kprobes/probe1/enable

 # cat /sys/kernel/debug/kprobes/list
 c069ce4c  k  schedule+0x0    [OPTIMIZED]

Or 

 # perf record -f -a -e probe:schedule cat /sys/kernel/debug/kprobes/list
 c069cb8c  k  schedule+0x0    [OPTIMIZED]
 [ perf record: Woken up 1 times to write data ]
 [ perf record: Captured and wrote 0.036 MB perf.data (~1586 samples) ]


Note:
 Which probe can be optimized is depends on the actual kernel binary.
 So, in some cases, it might not be optimized. Please try to probe
 another place in that case.


Thank you,

---

Masami Hiramatsu (18):
      perf probe: Add lazy line matching support
      perf probe: show more lines after last line
      perf probe: Check function address range strictly in line finder
      perf probe: Use libdw callback routines
      perf probe: Use elfutils-libdw for analyzing debuginfo
      perf probe: Rename probe finder functions
      perf probe: Fix bugs in line range finder
      perf probe: Update perf probe document
      perf probe: Do not show --line option without dwarf support
      kprobes: Add documents of jump optimization
      kprobes/x86: Support kprobes jump optimization on x86
      x86: Add text_poke_smp for SMP cross modifying code
      kprobes/x86: Cleanup save/restore registers
      kprobes/x86: Boost probes when reentering
      kprobes: Jump optimization sysctl interface
      kprobes: Introduce kprobes jump optimization
      kprobes: Introduce generic insn_slot framework
      kprobes/x86: Cleanup RELATIVEJUMP_INSTRUCTION to RELATIVEJUMP_OPCODE


 Documentation/kprobes.txt               |  207 ++++++
 arch/Kconfig                            |   13 
 arch/x86/Kconfig                        |    1 
 arch/x86/include/asm/alternative.h      |    4 
 arch/x86/include/asm/kprobes.h          |   31 +
 arch/x86/kernel/alternative.c           |   60 ++
 arch/x86/kernel/kprobes.c               |  609 ++++++++++++++++---
 include/linux/kprobes.h                 |   44 +
 kernel/kprobes.c                        |  647 +++++++++++++++++---
 kernel/sysctl.c                         |   12 
 tools/perf/Documentation/perf-probe.txt |   58 ++
 tools/perf/Makefile                     |   10 
 tools/perf/builtin-probe.c              |   36 +
 tools/perf/util/probe-event.c           |   55 +-
 tools/perf/util/probe-finder.c          | 1002 ++++++++++++++-----------------
 tools/perf/util/probe-finder.h          |   53 +-
 tools/perf/util/string.c                |   55 +-
 tools/perf/util/string.h                |    1 
 18 files changed, 2063 insertions(+), 835 deletions(-)

-- 
Masami Hiramatsu
e-mail: mhiramat@redhat.com

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

end of thread, other threads:[~2010-03-03  0:57 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-25 13:33 [PATCH -tip v3&10 00/18] perf-probe updates - optprobe, elfutils and lazy matching Masami Hiramatsu
2010-02-25 13:33 ` [PATCH -tip v3&10 01/18] kprobes/x86: Cleanup RELATIVEJUMP_INSTRUCTION to RELATIVEJUMP_OPCODE Masami Hiramatsu
2010-02-25 15:10   ` Mathieu Desnoyers
2010-02-25 19:27   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:33 ` [PATCH -tip v3&10 02/18] kprobes: Introduce generic insn_slot framework Masami Hiramatsu
2010-02-25 15:21   ` Mathieu Desnoyers
2010-03-02  2:55     ` Masami Hiramatsu
2010-03-03  0:18       ` Masami Hiramatsu
2010-03-03  0:32         ` Mathieu Desnoyers
2010-03-03  0:35           ` Masami Hiramatsu
2010-02-25 19:28   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:34 ` [PATCH -tip v3&10 03/18] kprobes: Introduce kprobes jump optimization Masami Hiramatsu
2010-02-25 19:28   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:34 ` [PATCH -tip v3&10 04/18] kprobes: Jump optimization sysctl interface Masami Hiramatsu
2010-02-25 19:28   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:34 ` [PATCH -tip v3&10 05/18] kprobes/x86: Boost probes when reentering Masami Hiramatsu
2010-02-25 19:29   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:34 ` [PATCH -tip v3&10 06/18] kprobes/x86: Cleanup save/restore registers Masami Hiramatsu
2010-02-25 19:29   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:34 ` [PATCH -tip v3&10 07/18] x86: Add text_poke_smp for SMP cross modifying code Masami Hiramatsu
2010-02-25 15:33   ` Mathieu Desnoyers
2010-02-26  3:53     ` Masami Hiramatsu
2010-03-03  0:48       ` Mathieu Desnoyers
2010-03-03  0:56         ` Masami Hiramatsu
2010-02-25 19:29   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:34 ` [PATCH -tip v3&10 08/18] kprobes/x86: Support kprobes jump optimization on x86 Masami Hiramatsu
2010-02-25 19:29   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:35 ` [PATCH -tip v3&10 09/18] kprobes: Add documents of jump optimization Masami Hiramatsu
2010-02-25 19:30   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:35 ` [PATCH -tip v3&10 10/18] perf probe: Do not show --line option without dwarf support Masami Hiramatsu
2010-02-25 19:30   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:35 ` [PATCH -tip v3&10 11/18] perf probe: Update perf probe document Masami Hiramatsu
2010-02-25 19:30   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:35 ` [PATCH -tip v3&10 12/18] perf probe: Fix bugs in line range finder Masami Hiramatsu
2010-02-25 19:30   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:35 ` [PATCH -tip v3&10 13/18] perf probe: Rename probe finder functions Masami Hiramatsu
2010-02-25 19:31   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:35 ` [PATCH -tip v3&10 14/18] perf probe: Use elfutils-libdw for analyzing debuginfo Masami Hiramatsu
2010-02-25 19:31   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:35 ` [PATCH -tip v3&10 15/18] perf probe: Use libdw callback routines Masami Hiramatsu
2010-02-25 19:31   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:35 ` [PATCH -tip v3&10 16/18] perf probe: Check function address range strictly in line finder Masami Hiramatsu
2010-02-25 19:31   ` [tip:perf/probes] " tip-bot for Masami Hiramatsu
2010-02-25 13:36 ` [PATCH -tip v3&10 17/18] perf probe: show more lines after last line Masami Hiramatsu
2010-02-25 19:32   ` [tip:perf/probes] perf probe: Show " tip-bot for Masami Hiramatsu
2010-02-25 13:36 ` [PATCH -tip v3&10 18/18] perf probe: Add lazy line matching support Masami Hiramatsu
2010-02-25 19:32   ` [tip:perf/probes] " tip-bot for 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.