[PATCH v4 0/8] tracing: Allow system call tracepoints to handle page faults
From: Mathieu Desnoyers
Date: Tue Oct 08 2024 - 21:09:35 EST
Wire up the system call tracepoints with Tasks Trace RCU to allow
the ftrace, perf, and eBPF tracers to handle page faults.
This series does the initial wire-up allowing tracers to handle page
faults, but leaves out the actual handling of said page faults as future
work.
This series was compile and runtime tested with ftrace and perf syscall
tracing and raw syscall tracing, adding a WARN_ON_ONCE() in the
generated code to validate that the intended probes are used for raw
syscall tracing. The might_fault() added within those probes validate
that they are called from a context where handling a page fault is OK.
The eBPF people have been needing this feature for quite a while:
https://lore.kernel.org/lkml/c323bce9-a04e-b1c3-580a-783fde259d60@xxxxxx/
This series replaces the "Faultable Tracepoints v6" series found at [1].
This has been rebased on trace/core commit:
1537519062e2 (trace/core) tracepoint: Remove SRCU protection
The changes since v3 take care of feedback from Steven.
Thanks,
Mathieu
Link: https://lore.kernel.org/lkml/20240828144153.829582-1-mathieu.desnoyers@xxxxxxxxxxxx/ # [1]
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Alexei Starovoitov <ast@xxxxxxxxxx>
Cc: Yonghong Song <yhs@xxxxxx>
Cc: Paul E. McKenney <paulmck@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Mark Rutland <mark.rutland@xxxxxxx>
Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx>
Cc: bpf@xxxxxxxxxxxxxxx
Cc: Joel Fernandes <joel@xxxxxxxxxxxxxxxxx>
Cc: linux-trace-kernel@xxxxxxxxxxxxxxx
Mathieu Desnoyers (8):
tracing: Declare system call tracepoints with TRACE_EVENT_SYSCALL
tracing/ftrace: disable preemption in syscall probe
tracing/perf: disable preemption in syscall probe
tracing/bpf: disable preemption in syscall probe
tracing: Allow system call tracepoints to handle page faults
tracing/ftrace: Add might_fault check to syscall probes
tracing/perf: Add might_fault check to syscall probes
tracing/bpf: Add might_fault check to syscall probes
include/linux/tracepoint.h | 71 ++++++++++++++++++++++++++-------
include/trace/bpf_probe.h | 14 +++++++
include/trace/define_trace.h | 5 +++
include/trace/events/syscalls.h | 4 +-
include/trace/perf.h | 44 ++++++++++++++++++--
include/trace/trace_events.h | 62 ++++++++++++++++++++++++++--
init/Kconfig | 1 +
kernel/trace/trace_syscalls.c | 28 +++++++++++++
8 files changed, 205 insertions(+), 24 deletions(-)
--
2.39.2