• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

perf: command not found

by Deepika

perf is a Linux tool that measures performance-related data in a variety of ways, including hardware performance counters and tracepoints. It provides an interface for analyzing the performance of the operating system, applications, and other system components.

The perf tool is built into the Linux kernel, and it can be used to collect and analyze performance data in a number of ways. For example, it can be used to count the number of CPU cycles consumed by a particular process, or to monitor memory accesses and cache misses. It can also be used to trace events in the system, such as function calls and context switches.

One of the main advantages of perf is that it provides a unified interface for accessing performance data, making it easier for developers and performance engineers to work with performance-related data. Additionally, perf is extensible, meaning that it can be extended to support new performance counters and tracepoints as they become available.

If you encounter the below error while running the command perf:

perf: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
Debian apt-get install perf
Ubuntu apt-get install perf
Arch Linux pacman -S perf
Kali Linux apt-get install perf
CentOS yum install perf
Fedora dnf install perf
Raspbian apt-get install perf

perf Command Examples

1. Display basic performance counter stats for a command:

# perf stat gcc hello.c

2. Display system-wide real-time performance counter profile:

# sudo perf top

3. Run a command and record its profile into `perf.data`:

# sudo perf record command

4. Record the profile of an existing process into `perf.data`:

# sudo perf record -p pid

5. Read `perf.data` (created by `perf record`) and display the profile:

# sudo perf report

Summary

Overall, perf is a valuable tool for performance analysis and optimization on Linux systems, and it is widely used by developers and performance engineers to understand the behavior of their systems and to identify performance bottlenecks.

Filed Under: Linux

Some more articles you might also be interested in …

  1. cuyo Command Examples in Linux
  2. lrztar: command not found
  3. ghdl: Open-source simulator for the VHDL language
  4. numlockx Command Examples in Linux
  5. getfacl Command Examples in Linux
  6. iptables: command not found
  7. How to Disable IPv6 in CentOS/RHEL 8
  8. “git show-refs” Command Examples
  9. “az vm” Command Examples (Manage virtual machines in Azure)
  10. xargs Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • “glab alias” Command Examples
  • gixy Command Examples
  • gitsome Command Examples
  • gitmoji Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright