Generated by GPT-5-mini| perf (Linux profiling) | |
|---|---|
| Name | perf |
| Title | perf |
| Developer | Linus Torvalds, Ingo Molnár, Linaro |
| Released | 2010 |
| Programming language | C (programming language) |
| Operating system | Linux |
| License | GNU General Public License |
perf (Linux profiling) perf is a performance analysis tool for Linux kernels and user-space applications, designed to collect and analyze hardware and software performance events. It is distributed as part of the Linux kernel source tree and commonly used by developers working with Red Hat, Canonical, SUSE, and Intel toolchains. perf integrates with kernel tracing interfaces and complements profiling systems from projects such as SystemTap, DTrace, eBPF, and Valgrind.
perf provides sampling-based profiling, tracing, and performance counter aggregation to diagnose bottlenecks in systems built by organizations like Google, Facebook, Amazon and Netflix. It accesses processor performance monitoring units (PMUs) supported by vendors such as Intel, AMD, and ARM to report events used by engineers at Mozilla and Oracle for optimization. perf’s feature set overlaps and interoperates with tools from the GNU Project and the Linux Foundation ecosystem.
perf’s architecture relies on kernel interfaces introduced by contributors including Linus Torvalds and Ingo Molnár; it bridges user-space utilities and kernel subsystems such as perf_event_open, the ftrace framework, and the pmu subsystem. Core components include the perf user-space binary, kernel event handlers, and supporting libraries used by distributions maintained by Debian and Fedora. perf records events into an in-memory buffer managed by the kernel and exposes them to frontends like FlameGraph generators and viewers maintained by communities around Brendan Gregg. Integrations with package maintainers at Red Hat and SUSE ensure availability in enterprise distributions.
Common perf commands (used by engineers at Canonical and Intel) include perf record, perf report, perf stat, perf top, and perf trace. perf record samples via hardware PMUs or software events such as context switches and page faults handled by kernel developers at Greg Kroah-Hartman-influenced trees. perf report produces call-graph summaries useful to performance teams at Mozilla and Netflix. Administrators at Oracle Corporation and Google often combine perf top with system monitors from Prometheus exporters or visualization tools like Grafana for continuous profiling.
perf exposes hardware events (e.g., CPU cycles, cache-misses) supported by Intel and AMD microarchitectures and software events (e.g., cpu-clock, context-switches) defined by the Linux kernel community. Event attributes map to counters implemented in PMUs designed by ARM and Intel architects. Metrics produced by perf are used in performance tuning at NVIDIA and IBM datacenters, and for CPU microbenchmarking by researchers at MIT and Stanford University.
Typical workflows employ perf record to gather samples, perf report to analyze hotspots, and flame graph tools popularized by Brendan Gregg for visualization. Developers at Google and Facebook use perf in CI pipelines alongside static analyzers from Coverity and test frameworks maintained by Apache projects. Example scenarios include optimizing database engines from MySQL or PostgreSQL, profiling web servers like Nginx and Apache HTTP Server under load, and tuning virtualized environments on hypervisors such as KVM and Xen.
perf integrates with tracing solutions such as ftrace, SystemTap, and eBPF frameworks championed by contributors like Alexei Starovoitov. Tooling ecosystems include GUI viewers, continuous profiling stacks developed by Facebook and Google, and specialized analyzers used by Canonical and Red Hat engineers. Third-party projects provide converters to formats consumed by FlameGraph and by observability platforms like Grafana and Prometheus; integration efforts often involve vendors such as Intel, AMD, and ARM for PMU compatibility.
perf originated from in-kernel performance-counter support merged into the Linux kernel around 2010, with maintainership and contributions from kernel developers affiliated with Intel and the Linux Foundation. Key contributors include Ingo Molnár and other maintainers who coordinated with distribution teams at Debian and Fedora. Over time, perf evolved to support new PMU features from Intel microarchitectures, ARM extensions, and enhancements driven by organizations such as Linaro and cloud providers like AWS that required large-scale profiling capabilities.