From: Nam Cao <namcao@linutronix.de>
To: Steven Rostedt <rostedt@goodmis.org>,
Gabriele Monaco <gmonaco@redhat.com>,
linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: john.ogness@linutronix.de, Nam Cao <namcao@linutronix.de>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 17/23] arm64: mm: Add page fault trace points
Date: Tue, 29 Apr 2025 14:01:02 +0200 [thread overview]
Message-ID: <554038c996662282df8a9d0482ef06f8d44fccc5.1745926331.git.namcao@linutronix.de> (raw)
In-Reply-To: <cover.1745926331.git.namcao@linutronix.de>
Add page fault trace points, which are useful to implement RV monitor which
watches page faults.
Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
---
arch/arm64/mm/fault.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index ef63651099a9..e3f096b0dffd 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -44,6 +44,9 @@
#include <asm/tlbflush.h>
#include <asm/traps.h>
+#define CREATE_TRACE_POINTS
+#include <trace/events/exceptions.h>
+
struct fault_info {
int (*fn)(unsigned long far, unsigned long esr,
struct pt_regs *regs);
@@ -559,6 +562,11 @@ static int __kprobes do_page_fault(unsigned long far, unsigned long esr,
if (kprobe_page_fault(regs, esr))
return 0;
+ if (user_mode(regs))
+ trace_page_fault_user(addr, regs, esr);
+ else
+ trace_page_fault_kernel(addr, regs, esr);
+
/*
* If we're in an interrupt or have no user context, we must not take
* the fault.
--
2.39.5
next prev parent reply other threads:[~2025-04-29 12:01 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-29 12:00 [PATCH v5 00/23] RV: Linear temporal logic monitors for RT application Nam Cao
2025-04-29 12:00 ` [PATCH v5 01/23] rv: Add #undef TRACE_INCLUDE_FILE Nam Cao
2025-04-29 12:00 ` [PATCH v5 02/23] printk: Make vprintk_deferred() public Nam Cao
2025-04-29 12:00 ` [PATCH v5 03/23] panic: Add vpanic() Nam Cao
2025-04-29 12:00 ` [PATCH v5 04/23] rv: Let the reactors take care of buffers Nam Cao
2025-04-29 12:00 ` [PATCH v5 05/23] verification/dot2k: Make a separate dot2k_templates/Kconfig_container Nam Cao
2025-04-29 12:00 ` [PATCH v5 06/23] verification/dot2k: Remove __buff_to_string() Nam Cao
2025-04-29 12:00 ` [PATCH v5 07/23] verification/dot2k: Replace is_container() hack with subparsers Nam Cao
2025-04-29 12:00 ` [PATCH v5 08/23] rv: rename CONFIG_DA_MON_EVENTS to CONFIG_RV_MON_EVENTS Nam Cao
2025-04-29 12:00 ` [PATCH v5 09/23] verification/dot2k: Prepare the frontend for LTL inclusion Nam Cao
2025-04-29 12:00 ` [PATCH v5 10/23] Documentation/rv: Prepare monitor synthesis document " Nam Cao
2025-04-29 12:00 ` [PATCH v5 11/23] verification/rvgen: Restructure the templates files Nam Cao
2025-04-29 12:00 ` [PATCH v5 12/23] verification/rvgen: Restructure the classes to prepare for LTL inclusion Nam Cao
2025-04-29 12:00 ` [PATCH v5 13/23] rv: Add support for LTL monitors Nam Cao
2025-04-29 12:00 ` [PATCH v5 14/23] rv: Add rtapp container monitor Nam Cao
2025-04-29 12:01 ` [PATCH v5 15/23] x86/tracing: Remove redundant trace_pagefault_key Nam Cao
2025-04-29 12:01 ` [PATCH v5 16/23] x86/tracing: Move page fault trace points to generic Nam Cao
2025-04-29 12:01 ` Nam Cao [this message]
2025-04-29 12:01 ` [PATCH v5 18/23] riscv: mm: Add page fault trace points Nam Cao
2025-04-29 12:01 ` [PATCH v5 19/23] rv: Add rtapp_pagefault monitor Nam Cao
2025-04-29 12:01 ` [PATCH v5 20/23] locking/rtmutex: Add block_on_rt_mutex tracepoints Nam Cao
2025-04-29 12:01 ` [PATCH v5 21/23] rv: Add rtapp_sleep monitor Nam Cao
2025-04-29 16:01 ` Gabriele Monaco
2025-04-29 17:20 ` Nam Cao
2025-04-30 8:05 ` Gabriele Monaco
2025-04-30 8:38 ` Nam Cao
2025-04-29 12:01 ` [PATCH v5 22/23] rv: Add documentation for rtapp monitor Nam Cao
2025-04-29 12:01 ` [PATCH v5 23/23] rv: Allow to configure the number of per-task monitor Nam Cao
2025-08-10 21:12 ` [PATCH v5 00/23] RV: Linear temporal logic monitors for RT application patchwork-bot+linux-riscv
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=554038c996662282df8a9d0482ef06f8d44fccc5.1745926331.git.namcao@linutronix.de \
--to=namcao@linutronix.de \
--cc=catalin.marinas@arm.com \
--cc=gmonaco@redhat.com \
--cc=john.ogness@linutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=will@kernel.org \
/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
all inboxes | Powered by JetHome®