From 934b67ac0b31fe7a349cb73aeb45e54bd67c5a48 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Fri, 5 Jul 2024 15:15:53 +0200 Subject: [PATCH] Trace sched events from stage1 Events from the kthread that dumps the buffer to the console are filtered, otherwise we make an infinite loop. --- lagarto-ox.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lagarto-ox.nix b/lagarto-ox.nix index 319cb5c..2da2c5e 100644 --- a/lagarto-ox.nix +++ b/lagarto-ox.nix @@ -87,6 +87,16 @@ preDeviceCommands = '' echo "Creating a heartbeat counter at 0x1bfff0000" sh -c 'hb=0; while [ 1 ]; do let hb=$hb+1; devmem 0x1bfff0000 32 $hb; done' & + '' + + + # Exclude the second pid, which is the kthread that will dump the trace to + # the console, otherwise we live lock the kernel. Then enable the sched + # events. + '' + echo "Exclude pid 2 from sched" + echo '(prev_pid != 2 && next_pid != 2)' > /sys/kernel/debug/tracing/events/sched/filter + echo "Enable all events from sched subsystem" + echo 1 > /sys/kernel/debug/tracing/events/sched/enable ''; };