Is there any method to run perf under WSL?

WARNING: perf not found for kernel 4.19.84-microsoft

Because WSL2 uses custom Linux kernel. Its source code can be found here
microsoft/WSL2-Linux-Kernel. We have to compile perf tools from it.


  • Install required build packages. If you are using Ubuntu in WSL2 this is the
    required command:
sudo apt install build-essential flex bison libssl-dev libelf-dev
  • Clone the WSL2 Linux kernel repository:
git clone --depth=1
  • Go to perf folder and compile it:
cd WSL2-Linux-Kernel/tools/perf

perf executable file will be in that folder.

Leave a Comment