perf

Framework for Linux performance counter measurements. More information: <https://perf.wiki.kernel.org>.

Install

All systems
curl cmd.cat/perf.sh
Debian Debian
apt-get install perf
Ubuntu
apt-get install perf
Arch Arch Linux
pacman -S perf
image/svg+xml Kali Linux
apt-get install perf
CentOS
yum install perf
Fedora
dnf install perf
Windows (WSL2)
sudo apt-get update sudo apt-get install perf
Raspbian
apt-get install perf

Framework for Linux performance counter measurements. More information: <https://perf.wiki.kernel.org>.

  • Display basic performance counter stats for a command:
    perf stat gcc hello.c
  • Display system-wide real-time performance counter profile:
    sudo perf top
  • Run a command and record its profile into `perf.data`:
    sudo perf record command
  • Record the profile of an existing process into `perf.data`:
    sudo perf record -p pid
  • Read `perf.data` (created by `perf record`) and display the profile:
    sudo perf report

© tl;dr; authors and contributors