The scx-analyzer traces SCX callback invocations and displays them in a GUI using Perfetto.
$ git submodule init
$ git submodule update
$ cd libbpf/src
$ make DESTDIR=../../_INSTALL install
Follow the Perfetto Quickstart Documentation for detailed instructions. Then, execute the following commands to build the Perfetto Tracebox:
$ cd perfetto
$ tools/install-build-deps
$ tools/gn gen --args='is_debug=false' out/linux
$ tools/ninja -C out/linux tracebox traced traced_probes perfetto
After completing these steps, the tracebox binary will be located at perfetto/out/linux/tracebox.
To build the scheduler, run the following commands:
$ cd scheduler
$ cargo build
To build the scx-analyzer, use the following commands:
$ cmake -B build
$ cmake --build build
Run the scheduler with the following command:
$ sudo scheduler/target/debug/scheduler
[*] BPF scheduler starting!
First, run traced in the background:
$ sudo perfetto/out/linux/tracebox traced --background
$ sudo perfetto/out/linux/tracebox traced_probes --background
Next, execute the scx-analyzer:
$ sudo build/scx_analyzer
Starting scx-analyzer
Collecting data, CTRL+c to stop
Successfully open output file! fd=7
After running the scx-analyzer, an output.perfetto-trace file will be generated in the current directory. To view the trace data, use the Perfetto UI. Open the file in the Perfetto Trace Viewer for a detailed visualization of the collected trace data.
SCX events are located in 'Misc Global Tracks' section and are organized into per-CPU tracks.