Skip to content

clone/kprobe: Do not use do_fork() when not defined

Petr Mladek lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2clone: Declare do_fork() only when availableinclude/linux/sched.h+2 -01 reply
2/2kprobe: Use _do_fork() in samples to make them work againsamples/kprobes/jprobe_example.c samples/kprobes/kprobe_example.c samples/kprobes/kretprobe_example.c+12 -120 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/2] clone/kprobe: Do not use do_fork() when not defined

The commit 3033f14ab78c32687 ("clone: support passing tls argument via C rather than pt_regs magic") introduced _do_fork() that allowed to pass @tls parameter.

The old do_fork() is defined only for architectures that are not ready to use this way and do not define HAVE_COPY_THREAD_TLS.

1st patch fixes do_fork() declaration.

2nd patch fixes kprobe samples to work again.

BTW: I think about renaming _do_fork() to do_fork_tls(). Then it will use the same naming scheme as copy_thread()/copy_thread_tls().

Petr Mladek (2):
clone: Declare do_fork() only when available
kprobe: Use _do_fork() in samples to make them work again

 include/linux/sched.h               |  2 ++
 samples/kprobes/jprobe_example.c    | 14 +++++++-------
 samples/kprobes/kprobe_example.c    |  6 +++---
 samples/kprobes/kretprobe_example.c |  4 ++--
 4 files changed, 14 insertions(+), 12 deletions(-)
Signature · 1 line
1.8.5.6