Re: [PATCH] sched: Add trace events for Proxy Execution (PE)

From: Metin Kaya
Date: Wed Feb 21 2024 - 09:25:13 EST


On 21/02/2024 2:23 pm, Steven Rostedt wrote:
On Fri, 2 Feb 2024 08:33:38 +0000
Metin Kaya <metin.kaya@xxxxxxx> wrote:

Add sched_[start, finish]_task_selection trace events to measure the
latency of PE patches in task selection.

Moreover, introduce trace events for interesting events in PE:
1. sched_pe_enqueue_sleeping_task: a task gets enqueued on wait queue of
a sleeping task (mutex owner).
2. sched_pe_cross_remote_cpu: dependency chain crosses remote CPU.
3. sched_pe_task_is_migrating: mutex owner task migrates.

New trace events can be tested via this command:
$ perf trace \
-e sched:sched_start_task_selection \
-e sched:sched_finish_task_selection \
-e sched:sched_pe_enqueue_sleeping_task \
-e sched:sched_pe_cross_remote_cpu \
-e sched:sched_pe_task_is_migrating

Notes:
1. These trace events are not intended to merge upstream. Instead, they
are only for making PE tests easier and will be converted to trace
points once PE patches hit upstream.

I wonder if the tracepoints should be added though? That is, not adding the
trace_events that show up in tracefs, but just the tracepoints so that bpf
or local modules could hook to them?

Yep, the intention is providing necessary support for modules (e.g., https://github.com/ARM-software/lisa/blob/main/lisa/_assets/kmodules/lisa/tp.c).


-- Steve


2. This patch is based on John's Proxy Execution v7 patch series (see
the link below) which is also available at
https://github.com/johnstultz-work/linux-dev/commits/proxy-exec-v7-6.7-rc6/.

Link: https://lore.kernel.org/linux-kernel/CANDhNCrHd+5twWVNqBAhVLfhMhkiO0KjxXBmwVgaCD4kAyFyWw@xxxxxxxxxxxxxx/