A collection of performance analysis tools, recipes, handy scripts, microbenchmarks & more
Python
149
1,058 commits
updated Apr 14, 2026

perf-tools is an open-source package that profiles workloads, identifies issues, and maps them to application code. It is the home for a collection of performance analysis tools, recipes, micro-benchmarks & more
git clone --recurse-submodules https://github.com/aayasin/perf-tools
./do.py setup-perf./do.py disable-smt; don't forget to re-enable it once done, e.g. ./do.py enable-smt./do.py disable-prefetches to disable hardware prefetches. Ditto re-enable comment for this/next commands../do.py enable-fix-freq to use fixed-frequency (in paritcular disables Turbo)../do.py disable-atom to disable E-cores in Hybrid processors.First, edit run.sh to invoke your application or use the -a '<your app and its args>', alternatively.
System-wide profiling is supported as well.
to profile, simply ./do.py profile which includes multiple steps:
A filtered output will be dumped on screen while all logs are saved to the current directory.
Use --profile-mask 42, as an example, to invoke subset of all steps.
For topdown profiling and advanced sampling, see system requirements.
./do.py log will only log hardware and software setup.
./do.py setup-all will setup all required tool (fetch and build those needed. Internet access required).
./do.py setup-perf profile will setup just perf then do default profiling (multiple commands can be used at once).
./do.py tar will archive all logs into a shareable tar file.
./do.py all will setup perf before doing all above profiling steps.
./do.py profile -pm 13a -v1 will do selected profile steps - per-app counting, sampling, topdown 2-levels,
sampling w/ LBR - and print underlying commands as well.
./do.py help -m My_Metric will print description of given metric (that toplev understands)
cd kernels/ && ./build.py, orGEN=0 ./build.sh from kernels/ dir to re-build the kernels without generating them ./kernels/jumpy5p14 200000000 ./kernels/gen-kernel.py -i PAUSE -n 10
outputs a C-file of a loop with 10 PAUSE instructions, that can be fed to your favorite compiler.A set of command-line tools to facilitate profiling
Shortcuts to set-up required tools or run workloads
./do.py build-perf to let it
use the installer of your Linux distribution (Ubuntu is the default)../do.py setup-all --tune :xed:1.Required Linux kernel for most recent processors 🎉
| Intel product | Kernel version | perf version |
|---|---|---|
| Ice Lake | 5.10 | |
| Rocket Lake | 5.11 | |
| Alder Lake | 5.13 | 5.17 |
| Raptor Lake | 5.18 | |
| Sapphire Rapids | 5.18 | |
| Meteor Lake | 6.4 | 6.3 or 6.5 onwards |
| Granite Rapids | 6.8 | 6.6 (or 6.12 for Timed PEBS) |
| Lunar Lake | 6.10 | 6.7 |
| Panther Lake | 6.18 | 6.18 |
Besides, perf tool version 5.13 or newer is required (except observed broken perf versions). See do.py --install-perf for more.
398 followers · starred Mar 2025
54 followers · starred Jan 2023
60 followers · starred May 2023
2 followers · starred Nov 2022
A collection of performance analysis tools, recipes, handy scripts, microbenchmarks & more
Python
149
1,058 commits
updated Apr 14, 2026

perf-tools is an open-source package that profiles workloads, identifies issues, and maps them to application code. It is the home for a collection of performance analysis tools, recipes, micro-benchmarks & more
git clone --recurse-submodules https://github.com/aayasin/perf-tools
./do.py setup-perf./do.py disable-smt; don't forget to re-enable it once done, e.g. ./do.py enable-smt./do.py disable-prefetches to disable hardware prefetches. Ditto re-enable comment for this/next commands../do.py enable-fix-freq to use fixed-frequency (in paritcular disables Turbo)../do.py disable-atom to disable E-cores in Hybrid processors.First, edit run.sh to invoke your application or use the -a '<your app and its args>', alternatively.
System-wide profiling is supported as well.
to profile, simply ./do.py profile which includes multiple steps:
A filtered output will be dumped on screen while all logs are saved to the current directory.
Use --profile-mask 42, as an example, to invoke subset of all steps.
For topdown profiling and advanced sampling, see system requirements.
./do.py log will only log hardware and software setup.
./do.py setup-all will setup all required tool (fetch and build those needed. Internet access required).
./do.py setup-perf profile will setup just perf then do default profiling (multiple commands can be used at once).
./do.py tar will archive all logs into a shareable tar file.
./do.py all will setup perf before doing all above profiling steps.
./do.py profile -pm 13a -v1 will do selected profile steps - per-app counting, sampling, topdown 2-levels,
sampling w/ LBR - and print underlying commands as well.
./do.py help -m My_Metric will print description of given metric (that toplev understands)
cd kernels/ && ./build.py, orGEN=0 ./build.sh from kernels/ dir to re-build the kernels without generating them ./kernels/jumpy5p14 200000000 ./kernels/gen-kernel.py -i PAUSE -n 10
outputs a C-file of a loop with 10 PAUSE instructions, that can be fed to your favorite compiler.A set of command-line tools to facilitate profiling
Shortcuts to set-up required tools or run workloads
./do.py build-perf to let it
use the installer of your Linux distribution (Ubuntu is the default)../do.py setup-all --tune :xed:1.Required Linux kernel for most recent processors 🎉
| Intel product | Kernel version | perf version |
|---|---|---|
| Ice Lake | 5.10 | |
| Rocket Lake | 5.11 | |
| Alder Lake | 5.13 | 5.17 |
| Raptor Lake | 5.18 | |
| Sapphire Rapids | 5.18 | |
| Meteor Lake | 6.4 | 6.3 or 6.5 onwards |
| Granite Rapids | 6.8 | 6.6 (or 6.12 for Timed PEBS) |
| Lunar Lake | 6.10 | 6.7 |
| Panther Lake | 6.18 | 6.18 |
Besides, perf tool version 5.13 or newer is required (except observed broken perf versions). See do.py --install-perf for more.
398 followers · starred Mar 2025
54 followers · starred Jan 2023
60 followers · starred May 2023
2 followers · starred Nov 2022