linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>
Cc: linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Alexei Starovoitov <ast@kernel.org>, Yonghong Song <yhs@fb.com>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	bpf@vger.kernel.org, Joel Fernandes <joel@joelfernandes.org>
Subject: [PATCH v5 0/8] Faultable Tracepoints
Date: Thu, 27 Jun 2024 11:23:32 -0400	[thread overview]
Message-ID: <20240627152340.82413-1-mathieu.desnoyers@efficios.com> (raw)

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.

I have tested this against a feature branch of lttng-modules which
implements handling of page faults for the filename argument of the
openat(2) system call.

This v5 addresses comments from the previous round of review [1].

Steven Rostedt suggested separating tracepoints into two separate
sections. It is unclear how that approach would prove to be an
improvement over the currently proposed approach, so those changes were
not incorporated. See [2] for my detailed reply.

In the previous round, Peter Zijlstra suggested use of SRCU rather than
Tasks Trace RCU. See my reply about the distinction between SRCU and
Tasks Trace RCU [3] and this explanation from Paul E. McKenney about the
purpose of Tasks Trace RCU [4].

The macros DEFINE_INACTIVE_GUARD and activate_guard are added to
cleanup.h for use in the __DO_TRACE() macro. Those appear to be more
flexible than the guard_if() proposed by Peter Zijlstra in the previous
round of review [5].

This series is based on kernel v6.9.6.

Thanks,

Mathieu

Link: https://lore.kernel.org/lkml/20231120205418.334172-1-mathieu.desnoyers@efficios.com/ # [1]
Link: https://lore.kernel.org/lkml/e4e9a2bc-1776-4b51-aba4-a147795a5de1@efficios.com/ # [2]
Link: https://lore.kernel.org/lkml/a0ac5f77-411e-4562-9863-81196238f3f5@efficios.com/ # [3]
Link: https://lore.kernel.org/lkml/ba543d44-9302-4115-ac4f-d4e9f8d98a90@paulmck-laptop/ # [4]
Link: https://lore.kernel.org/lkml/20231120221524.GD8262@noisy.programming.kicks-ass.net/ # [5]
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Yonghong Song <yhs@fb.com>
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: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: bpf@vger.kernel.org
Cc: Joel Fernandes <joel@joelfernandes.org>

Mathieu Desnoyers (8):
  cleanup.h: Header include guard should match header name
  cleanup.h guard: Rename DEFINE_ prefix to DECLARE_
  cleanup.h: Introduce DEFINE_INACTIVE_GUARD and activate_guard
  tracing: Introduce faultable tracepoints
  tracing/ftrace: Add support for faultable tracepoints
  tracing/bpf-trace: Add support for faultable tracepoints
  tracing/perf: Add support for faultable tracepoints
  tracing: Convert sys_enter/exit to faultable tracepoints

 drivers/cxl/core/cdat.c                     |  2 +-
 drivers/cxl/cxl.h                           |  2 +-
 drivers/gpio/gpiolib.h                      |  2 +-
 drivers/platform/x86/intel/pmc/core_ssram.c |  2 +-
 fs/fuse/virtio_fs.c                         |  2 +-
 fs/pstore/inode.c                           |  4 +-
 include/linux/bitmap.h                      |  2 +-
 include/linux/cleanup.h                     | 85 ++++++++++++--------
 include/linux/cpu.h                         |  2 +-
 include/linux/cpumask.h                     |  2 +-
 include/linux/device.h                      |  6 +-
 include/linux/file.h                        |  4 +-
 include/linux/firmware.h                    |  2 +-
 include/linux/gpio/driver.h                 |  4 +-
 include/linux/iio/iio.h                     |  4 +-
 include/linux/irqflags.h                    |  4 +-
 include/linux/mutex.h                       |  6 +-
 include/linux/of.h                          |  2 +-
 include/linux/pci.h                         |  4 +-
 include/linux/percpu.h                      |  2 +-
 include/linux/preempt.h                     |  6 +-
 include/linux/rcupdate.h                    |  2 +-
 include/linux/rwsem.h                       | 10 +--
 include/linux/sched/task.h                  |  4 +-
 include/linux/slab.h                        |  4 +-
 include/linux/spinlock.h                    | 38 ++++-----
 include/linux/srcu.h                        |  2 +-
 include/linux/tracepoint-defs.h             | 14 ++++
 include/linux/tracepoint.h                  | 88 +++++++++++++++------
 include/sound/pcm.h                         |  6 +-
 include/trace/bpf_probe.h                   | 20 ++++-
 include/trace/define_trace.h                |  7 ++
 include/trace/events/syscalls.h             |  4 +-
 include/trace/perf.h                        | 22 +++++-
 include/trace/trace_events.h                | 68 +++++++++++++++-
 init/Kconfig                                |  1 +
 kernel/sched/core.c                         |  4 +-
 kernel/sched/sched.h                        | 16 ++--
 kernel/trace/bpf_trace.c                    | 11 ++-
 kernel/trace/trace_events.c                 | 28 +++++--
 kernel/trace/trace_fprobe.c                 |  5 +-
 kernel/trace/trace_syscalls.c               | 52 ++++++++++--
 kernel/tracepoint.c                         | 65 +++++++++------
 lib/locking-selftest.c                      | 12 +--
 sound/core/control_led.c                    |  2 +-
 45 files changed, 441 insertions(+), 193 deletions(-)

-- 
2.39.2

             reply	other threads:[~2024-06-27 15:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27 15:23 Mathieu Desnoyers [this message]
2024-06-27 15:23 ` [PATCH v5 1/8] cleanup.h: Header include guard should match header name Mathieu Desnoyers
2024-06-27 15:23 ` [PATCH v5 2/8] cleanup.h guard: Rename DEFINE_ prefix to DECLARE_ Mathieu Desnoyers
2024-06-27 15:23 ` [PATCH v5 3/8] cleanup.h: Introduce DEFINE_INACTIVE_GUARD and activate_guard Mathieu Desnoyers
2024-08-19 23:00   ` Steven Rostedt
2024-08-28 13:58     ` Mathieu Desnoyers
2024-06-27 15:23 ` [PATCH v5 4/8] tracing: Introduce faultable tracepoints Mathieu Desnoyers
2024-06-27 15:23 ` [PATCH v5 5/8] tracing/ftrace: Add support for " Mathieu Desnoyers
2024-06-27 15:23 ` [PATCH v5 6/8] tracing/bpf-trace: " Mathieu Desnoyers
2024-06-27 15:23 ` [PATCH v5 7/8] tracing/perf: " Mathieu Desnoyers
2024-06-27 15:23 ` [PATCH v5 8/8] tracing: Convert sys_enter/exit to " Mathieu Desnoyers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240627152340.82413-1-mathieu.desnoyers@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=joel@joelfernandes.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).