Thread (17 messages) flat view 17 messages, 3 authors, 2024-09-17

Re: [PATCH 0/8] tracing: Allow system call tracepoints to handle page faults

From: Andrii Nakryiko <hidden>
Date: 2024-09-11 23:09:06
Also in: bpf, lkml

On Mon, Sep 9, 2024 at 5:36 PM Mathieu Desnoyers
[off-list ref] wrote:
On 2024-09-09 19:53, Andrii Nakryiko wrote:
quoted
On Mon, Sep 9, 2024 at 1:17 PM Mathieu Desnoyers
[off-list ref] wrote:
quoted
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.

For ebpf, this series is compile-tested only.
What tree/branch was this based on? I can't apply it cleanly anywhere I tried...
This series was based on tag v6.10.6
Didn't find 6.10.6, but it applied cleanly to 6.10.3. I tested that
BPF parts work:

Tested-by: Andrii Nakryiko <andrii@kernel.org> # BPF parts
Sorry I should have included this information in patch 0.

Thanks,

Mathieu
quoted
quoted
This series replaces the "Faultable Tracepoints v6" series found at [1].

Thanks,

Mathieu

Link: https://lore.kernel.org/lkml/20240828144153.829582-1-mathieu.desnoyers@efficios.com/ (local) # [1]
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Yonghong Song <redacted>
Cc: Paul E. McKenney <paulmck@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Andrii Nakryiko <redacted>
Cc: bpf@vger.kernel.org
Cc: Joel Fernandes <redacted>
Cc: linux-trace-kernel@vger.kernel.org

Mathieu Desnoyers (8):
   tracing: Declare system call tracepoints with TRACE_EVENT_SYSCALL
   tracing/ftrace: guard syscall probe with preempt_notrace
   tracing/perf: guard syscall probe with preempt_notrace
   tracing/bpf: guard syscall probe with preempt_notrace
   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      | 87 +++++++++++++++++++++++++--------
  include/trace/bpf_probe.h       | 13 +++++
  include/trace/define_trace.h    |  5 ++
  include/trace/events/syscalls.h |  4 +-
  include/trace/perf.h            | 43 ++++++++++++++--
  include/trace/trace_events.h    | 61 +++++++++++++++++++++--
  init/Kconfig                    |  1 +
  kernel/entry/common.c           |  4 +-
  kernel/trace/trace_syscalls.c   | 36 ++++++++++++--
  9 files changed, 218 insertions(+), 36 deletions(-)

--
2.39.2
--
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help