From 1567f85239bd5f1a1cab325f3cd2ce376128c58c Mon Sep 17 00:00:00 2001 From: Phil Milewski Date: Wed, 7 Jan 2026 11:06:28 +0100 Subject: [PATCH 1/2] added wsl description for flamegraph --- benches/README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/benches/README.md b/benches/README.md index 52a274bc7..ca4e19049 100644 --- a/benches/README.md +++ b/benches/README.md @@ -36,7 +36,14 @@ You can also run the benchmarks using the profiler flamegraph. Details can be fo - [Flamegraph GitHub](https://github.com/flamegraph-rs/flamegraph). This provides insights on the where execution time is spent. -TODO: Check how to run it in WSL2 +But in WSL you need some more steps, since you need to install "perf" manually. + +So after `cargo install flamegraph`, you need to update "apt" with `sudo apt update` and install "build-essential's" by `sudo apt install -y build-essential libelf-dev libnuma-dev flex bison libdw-dev libunwind-dev libaudit-dev libslang2-dev libperl-dev python3-dev binutils-dev liblzma-dev libiberty-dev`.
+Then you go into the home directory with `cd ~` and install the linux kernel with
+`wget - https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.15.5.tar.xz` (Adjust the version as needed).
+After that you extract it with `tar -xvf linux-5.15.5.tar.xz` and move into "perf" with `cd linux-5.15.5/tools/perf` +there you use `make` to compile it. +The last step is to make "perf" visible by e.g. `sudo cp ./perf /usr/local/bin/`. ### Command ```cargo flamegraph --freq 63300 --bench benchmarks -- --bench --profile-time 5 ``` From 44b3a4b7ae564ab9027301337342be77b89fede7 Mon Sep 17 00:00:00 2001 From: Phil Milewski Date: Wed, 7 Jan 2026 11:11:09 +0100 Subject: [PATCH 2/2] adding to bench readme --- benches/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/benches/README.md b/benches/README.md index ca4e19049..c29c05777 100644 --- a/benches/README.md +++ b/benches/README.md @@ -36,6 +36,9 @@ You can also run the benchmarks using the profiler flamegraph. Details can be fo - [Flamegraph GitHub](https://github.com/flamegraph-rs/flamegraph). This provides insights on the where execution time is spent. +### Installing Flamegraph + +Installing Flamegraph in Linux and macOS is easy, since you only need to install flamegraph using `cargo install flamegraph`. But in WSL you need some more steps, since you need to install "perf" manually. So after `cargo install flamegraph`, you need to update "apt" with `sudo apt update` and install "build-essential's" by `sudo apt install -y build-essential libelf-dev libnuma-dev flex bison libdw-dev libunwind-dev libaudit-dev libslang2-dev libperl-dev python3-dev binutils-dev liblzma-dev libiberty-dev`.