Re: [PATCH v6 17/22] arm64: mm: Add page fault trace points

From: Will Deacon
Date: Mon May 19 2025 - 11:12:51 EST


On Fri, May 16, 2025 at 10:42:48AM -0400, Steven Rostedt wrote:
>
>
> On May 16, 2025 10:04:50 AM EDT, Will Deacon <will@xxxxxxxxxx> wrote:
> >
> >> + if (user_mode(regs))
> >> + trace_page_fault_user(addr, regs, esr);
> >> + else
> >> + trace_page_fault_kernel(addr, regs, esr);
> >
> >Why is this after kprobe_page_fault()?
> >
> >It's also a shame that the RV monitor can't hook into perf, as we
> >already have a sw event for page faults that you could use instead of
> >adding something new.
> >
>
> Perf events work for perf only. My question is why isn't this a tracepoint
> that perf could hook into?

Well, the perf event came first in this case, so we're stuck with it :/

I was hoping we could settle for a generic helper that could emit both
the trace event and the perf event (so that the ordering of the two is
portable across architectures) but, judging by Nam's reply, the trace
event is needed before kprobes gets a look in.

Will