1

There is a jprobe_example.c in v3. But it is missing in v4. I tried to compile v3 example having kernel v4 and it works giving me jprobe_example.ko, but when I try to insmod it, it fails with

insmod: ERROR: could not insert module jprobe_example.ko: Operation not permitted.

/var/log/syslog says that register_jprobe failed, returned -38

Another two examples are insmod-ed fine. So, the question is, were jprobes removed from the kernel v4? Why can I compile the module but not insmod it?

sanyassh
  • 8,100
  • 13
  • 36
  • 70

2 Answers2

2

jprobes are deprecated in the Linux kernel and the sample file was removed in commit 9be95bd:

commit 9be95bdc53c12ada23e39027237fd05e1393d893
Author: Masami Hiramatsu <mhiramat@kernel.org>
Date:   Fri Oct 6 08:15:57 2017 +0900

    kprobes: Remove the jprobes sample code

    Remove the jprobes sample module because jprobes are deprecated.

    [...]

That commit was merged in 4.15-rc1.

-38 is -ENOSYS, the error code for invalid system call numbers.

pchaigno
  • 11,313
  • 2
  • 29
  • 54
0

Masami Hiramatsu decide to abolish jprobe APIs in this email: https://lwn.net/Articles/735667/

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.

The reason I guess from the email is a bug talking about IRQs in https://lkml.org/lkml/2017/10/2/386