How to Install perf-tools on Windows 10
Perf-tools is a collection of performance analysis tools for Linux systems developed by Brendan Gregg. However, with the help of the Windows Subsystem for Linux (WSL), it's possible to install and use perf-tools on Windows 10. In this tutorial, we'll guide you through the installation process.
Prerequisites
Before we get started, make sure you have the following items:
- Windows 10 (version 1803 or later)
- WSL installed and configured (see Microsoft's documentation for instructions)
- Git installed on your Windows system (you can download it from here)
Steps
Open a Linux terminal by launching the WSL instance of your choice. You can do this by searching for "WSL" in the Windows start menu and selecting your preferred distribution.
Clone the
perf-toolsrepository from GitHub using the following command:git clone https://github.com/brendangregg/perf-tools.gitThis will create a
perf-toolsdirectory in your current location.Navigate to the newly created
perf-toolsdirectory by running:cd perf-toolsInstall necessary dependencies by running:
sudo apt-get install -y make gcc libelf-devBuild and install
perf-toolsby running:make && sudo make installThis will compile the
perftool and install it in/usr/local/bin/.Test that
perfis installed and working by running:perf topIf you see the profile of the system's top CPU-consuming processes as output, then
perfis working correctly.
Conclusion
That's it! You've successfully installed perf-tools on Windows 10 using WSL. With perf installed, you can now use it to analyze the performance of your Linux subsystem running on your Windows machine.