mirror of
https://github.com/JakeHillion/scx.git
synced 2024-12-04 23:07:11 +00:00
cc3fede8e0
Add a set of ftrace helper scripts for making perfetto compatible ftrace scheduler profiles. Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
13 lines
341 B
Bash
Executable File
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"
|