Skip to content

RFC kprobes: Abolish jprobe APIs

Masami Hiramatsu lkml 1 version In review

Get series with b4
b4 am 150724519527.5014.10207042218696587159.stgit@devbox

Versions newest first

  1. v1 RFC Latest5 patches 28 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5kprobes: Use ENOTSUPP instead of ENOSYSinclude/linux/kprobes.h kernel/kprobes.c+10 -102 replies
2/5kprobes: Abolish jprobe APIsinclude/linux/kprobes.h kernel/kprobes.c+20 -220 replies
3/5kprobes: Disable jprobe test codekernel/test_kprobes.c+8 -10 replies
4/5kprobes: Remove jprobe sample codesamples/kprobes/Makefile samples/kprobes/jprobe_example.c+1 -680 replies
5/5kprobes: docs: Remove jprobe related documentDocumentation/kprobes.txt+51 -1020 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH -tip 0/5] kprobes: Abolish jprobe APIs

Hi,

This series abolishes jprobe APIs and remove or disable related code. This is a preparation of removing all jprobe code (including kprobe's break_handler.)
I'm not so sure how many jprobe users still exists, but please migrate your tool to trace-event or perf-probe.

As we discussed this thread ( https://lkml.org/lkml/2017/10/2/386 ), we decided to remove jprobe.

Nowadays ftrace and other tracing features are enough matured to replace jprobe use-cases. Users can safely use ftrace and perf probe etc. for their use cases. So we have better way. IOW, jprobe finished its task.

People who still use jprobe, must migrate to other tracing features. Please consider to migrate your tool to following options.

- Use trace-event to trace target function with arguments trace-event is a low-overhead (and almost no visible overhead if it is off) statically defined event interface. You can define new events and trace it via ftrace or any other tracing tools.
See following urls,
- https://lwn.net/Articles/379903/
- https://lwn.net/Articles/381064/
- https://lwn.net/Articles/383362/

- Use ftrace dynamic events (kprobe event) with perf-probe
If you build your kernel with debug info (CONFIG_DEBUG_INFO), you can find which register/stack is assigned to which local variable or arguments by using perf-probe and set up new event to trace it.
See following documents,
- Documentation/trace/kprobetrace.txt
- Documentation/trace/events.txt
- tools/perf/Documentation/perf-probe.txt

As far as I can see, tcp probe, dccp probe, sctp probe and lkdtm are using jprobe to probe function. Please consider to migrate.

Thank you,

---

Masami Hiramatsu (5):
kprobes: Use ENOTSUPP instead of ENOSYS
kprobes: Abolish jprobe APIs
kprobes: Disable jprobe test code
kprobes: Remove jprobe sample code
kprobes: docs: Remove jprobe related document

 Documentation/kprobes.txt        |  153 +++++++++++++-------------------------
 include/linux/kprobes.h          |   52 ++++++-------
 kernel/kprobes.c                 |    6 +
 kernel/test_kprobes.c            |    9 ++
 samples/kprobes/Makefile         |    2 
 samples/kprobes/jprobe_example.c |   67 -----------------
 6 files changed, 88 insertions(+), 201 deletions(-)
 delete mode 100644 samples/kprobes/jprobe_example.c

--
Masami Hiramatsu (Linaro) <[email protected]>