perf-probe updates - optprobe, elfutils and lazy matching
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest18 patches 28 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | kprobes/x86: Cleanup RELATIVEJUMP_INSTRUCTION to RELATIVEJUMP_OPCODEarch/ arch/ | +2 | 2 replies | |
| 2/18 | kprobes: Introduce generic insn_slot frameworkkernel/ | +65 | 6 replies | |
| 3/18 | kprobes: Introduce kprobes jump optimizationarch/ include/ kernel/ | +459 | 1 reply | |
| 4/18 | kprobes: Jump optimization sysctl interfaceinclude/ kernel/ kernel/ | +105 | 1 reply | |
| 5/18 | kprobes/x86: Boost probes when reenteringarch/ | +26 | 1 reply | |
| 6/18 | kprobes/x86: Cleanup save/restore registersarch/ | +67 | 1 reply | |
| 7/18 | x86: Add text_poke_smp for SMP cross modifying codearch/ arch/ | +63 | 5 replies | |
| 8/18 | kprobes/x86: Support kprobes jump optimization on x86arch/ arch/ arch/ | +441 | 1 reply | |
| 9/18 | kprobes: Add documents of jump optimizationDocumentation/ | +195 | 1 reply | |
| 10/18 | perf probe: Do not show --line option without dwarf supporttools/ | +2 | 1 reply | |
| 11/18 | perf probe: Update perf probe documenttools/ | +26 | 1 reply | |
| 12/18 | perf probe: Fix bugs in line range findertools/ | +1 | 1 reply | |
| 13/18 | perf probe: Rename probe finder functionstools/ tools/ tools/ | +8 | 1 reply | |
| 14/18 | perf probe: Use elfutils-libdw for analyzing debuginfotools/ tools/ tools/ +1 more | +314 | 1 reply | |
| 15/18 | perf probe: Use libdw callback routinestools/ tools/ | +86 | 1 reply | |
| 16/18 | perf probe: Check function address range strictly in line findertools/ tools/ | +53 | 1 reply | |
| 17/18 | perf probe: show more lines after last linetools/ | +7 | 1 reply | |
| 18/18 | perf probe: Add lazy line matching supporttools/ tools/ tools/ +4 more | +298 | 1 reply |
Reviews trailers per patch
1 of 18 patches has a Reviewed-by or Acked-by.
| Patch | Mathieu Desnoyers |
|---|---|
| 1/18 | A-b A-b |
| 2/18 | |
| 3/18 | |
| 4/18 | |
| 5/18 | |
| 6/18 | |
| 7/18 | |
| 8/18 | |
| 9/18 | |
| 10/18 | |
| 11/18 | |
| 12/18 | |
| 13/18 | |
| 14/18 | |
| 15/18 | |
| 16/18 | |
| 17/18 | |
| 18/18 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH -tip v3&10 00/18] perf-probe updates - optprobe, elfutils and lazy matching
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(-)
Signature · 2 lines
Masami Hiramatsu e-mail: [email protected]