Skip to content

uretprobes: return probes implementation

Anton Arapov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 24 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7uretprobes: preparation patchinclude/linux/uprobes.h kernel/events/uprobes.c+14 -11 reply
2/7uretprobes: extract fill_page() and trampoline implementationkernel/events/uprobes.c+26 -919 replies
3/7uretprobes/x86: hijack return addressarch/x86/include/asm/uprobes.h arch/x86/kernel/uprobes.c+30 -01 reply
4/7uretprobes: return probe entry, prepare_uretprobe()include/linux/uprobes.h kernel/events/uprobes.c+91 -18 replies
5/7uretprobes: return probe exit, invoke handlerskernel/events/uprobes.c+59 -15 replies
6/7uretprobes: limit the depth of return probe nestednessinclude/linux/uprobes.h kernel/events/uprobes.c+14 -01 reply
7/7uretprobes: implemented, thus remove -ENOSYSkernel/events/uprobes.c+0 -41 reply
7/7uretprobes: remove -ENOSYS as return probes implementedkernel/events/uprobes.c+0 -40 replies

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by.

PatchAnton ArapovSrikar Dronamraju
1/7
2/7A-b A-b A-b A-b A-b A-b A-b A-b A-b A-b
3/7
4/7
5/7
6/7
7/7
7/7

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/7] uretprobes: return probes implementation

Hello All,

this is core implementation of the uretprobes. This enables a breakpoint
on function's return for the tools such as perf.

Introduce additional handler* for uprobe consumer that makes possible the
distinguish uprobe from uretprobe. Note, behind every uretprobe a regular uprobe with return probe handler(rp_handler). Once hit the uprobe that has rp_handler, we hijack the return address of the probed function and replacing it with the address of trampoline. Trampoline is the preallocated page in probed task's xol area that filled with breakpoint opcode. In turn, when the return breakpoint is hit, invoke the rp_handler.

The patchset shouldn't be difficult to read and hopefully the comments to
commits will help.
Please, review.

patchset in git:
http://github.com/arapov/linux-aa/commits/uretprobes_v0

RFC reviews:
v4: https://lkml.org/lkml/2013/3/4/246
v3: https://lkml.org/lkml/2013/2/28/148
v2: https://lkml.org/lkml/2013/1/9/157
v1: https://lkml.org/lkml/2012/12/21/133

thanks,
Anton.

Anton Arapov (7):
uretprobes: preparation patch
uretprobes: extract fill_page() and trampoline implementation uretprobes/x86: hijack return address
uretprobes: return probe entry, prepare_uretprobe()
uretprobes: return probe exit, invoke handlers
uretprobes: limit the depth of return probe nestedness
uretprobes: remove -ENOSYS as return probes implemented

 arch/x86/include/asm/uprobes.h |   1 +
 arch/x86/kernel/uprobes.c      |  29 ++++++
 include/linux/uprobes.h        |   5 +
 kernel/events/uprobes.c        | 205 ++++++++++++++++++++++++++++++++++++++---
 4 files changed, 229 insertions(+), 11 deletions(-)
Signature · 1 line
1.8.1.4