Re: Interface for enabling context tracking

From: Steven Rostedt
Date: Thu Apr 10 2025 - 15:04:42 EST


On Thu, 10 Apr 2025 13:51:39 -0500
Junxuan Liao <ljx@xxxxxxxxxxx> wrote:

> Hi all,
>
> From what I can tell, tracepoints context_tracking:user_enter and
> user_exit might be useful for performance analysis. e.g. Figuring out how
> much time is spent handling page faults or in system calls. However
> context tracking is by default inactive and the only way to enable it is
> to turn on nohz_full for some CPUs.
>
> Is it a good idea to support turning on and off context tracking through
> some interface accessible from the userspace?
>

I think the best thing to do is to add trace events in all areas that enter
and exit the kernel normally (where noinstr is turned off). There's already
one for page faults on entry. It's been on my todo list to add one for page
fault exit (as I do care for how long they last.

I believe the irq vectors also have entry and exits trace events.

What else is missing?

-- Steve