scx/scripts/sched_ftrace.sh
Daniel Hodges cc3fede8e0
scripts: Add ftrace helper scripts
Add a set of ftrace helper scripts for making perfetto compatible ftrace
scheduler profiles.

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
2024-10-13 09:00:07 -04:00

13 lines
341 B
Bash
Executable File

#!/usr/bin/env bash
duration=${1:-5}
out=${2:-"$(pwd)/sched.ftrace"}
cd /sys/kernel/debug/tracing
echo 1 > tracing_on
echo 1 > events/sched/sched_switch/enable
timeout "${duration}" cat trace_pipe > "${out}.tmp"
echo 0 > events/sched/sched_switch/enable
echo 0 > tracing_on
cd -
./ftrace_trim "${out}.tmp" `nproc` > "${out}"
rm "${out}.tmp"