Last active
December 4, 2025 03:33
-
-
Save geerlingguy/842974c0e49c201c28f4be54a05cc89c to your computer and use it in GitHub Desktop.
Get core-to-core latency graph via c2clat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Make sure CPU is in performance mode (see notes in Gist comments). | |
| echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | |
| # Install c2clat and gnuplot-nox | |
| sudo apt install -y gnuplot-nox | |
| git clone https://github.com/rigtorp/c2clat | |
| cd c2clat | |
| g++ -O3 -DNDEBUG c2clat.cpp -o c2clat -pthread | |
| # Set up the PNG dimension (set to 4096,2160 for 96+ CPU cores) | |
| echo 'set terminal png size 1920,1080' >output.gnuplot | |
| # Run c2clat and create graph PNG | |
| ./c2clat -w -n "$(cat /sys/devices/virtual/dmi/id/board_{vendor,name,version} | xargs)" -p >> output.gnuplot | |
| gnuplot-nox output.gnuplot >output.png |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A few notes about running
c2clat:-Htoc2clatto warm up CPU cores for 200ms before beginning the measurement.-wto use write cycles instead of read cycles for measurement.echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governorscaling_governortoperformanceon the CPU might not set everything to the highest power mode... To ensure all CPU governors are inperformancemode, you can use sbc-bench.sh by running: