Generated by GPT-5-mini| Perf (Linux) | |
|---|---|
| Name | Perf |
| Title | Perf (Linux) |
| Developer | Linus Torvalds kernel community |
| Initial release | 2007 |
| Latest release | ongoing (in-kernel utility) |
| Operating system | Linux kernel |
| Programming language | C (programming language) |
| License | GNU General Public License |
Perf (Linux) Perf is a performance analysis tool integrated into the Linux kernel that provides profiling, tracing, and benchmarking capabilities for system and application performance. Originating from efforts within the Linux Foundation and driven by kernel developers around Intel Corporation, the utility leverages hardware and software event sources to analyze CPU, I/O, and scheduler behavior. Perf is widely used by practitioners from projects such as Mozilla, Google, and Red Hat for performance tuning and root-cause analysis.
Perf is distributed as part of the Linux kernel tree and maintained alongside contributions from developers affiliated with organizations like Intel Corporation, Advanced Micro Devices, and Linaro. It interacts with kernel subsystems including perf_events and interfaces with processor features from vendors such as ARM Limited and IBM POWER. System administrators and engineers from companies such as Facebook, Netflix, and Canonical (company) employ perf for profiling services running on distributions like Debian, Fedora, and Ubuntu (operating system).
Perf supports multiple profiling modes—sample-based, tracing, and statistical aggregation—using hardware performance counters present in x86 architecture, ARM architecture, and PowerPC CPUs. It can record call stacks, symbol information from toolchains like GNU Binutils and GCC, and correlate events with monitoring systems such as Prometheus when integrated. Advanced capabilities include branch tracing, cache-miss analysis, and off-CPU analysis used by teams at Microsoft, Oracle Corporation, and Twitter to diagnose latency sources.
Perf relies on kernel infrastructure including the perf_events subsystem, ftrace, and the BPF verifier introduced via eBPF development. Userland tooling interacts with kernel export points and libraries such as libbfd and uses DWARF data generated by GCC and Clang (compiler) for symbol resolution. The architecture ties together sources like hardware performance monitoring units (PMUs) from Intel and AMD, software tracepoints defined by projects like systemd and Kubernetes (software) for containerized workloads, and userspace helpers such as systemtap and valgrind for complementary analysis.
Common invocations include "perf record", "perf report", and "perf stat", which are used in workflows similar to performance practices at Netflix and Dropbox. Examples: - perf stat -e cpu-cycles,cache-misses ./myapp to gather aggregate metrics aligned with those used at Google LLC. - perf record -g ./server to capture call graphs for post-processing with perf report as used by engineers at Red Hat. - perf top for live sampling, a technique common to troubleshooting teams at Amazon (company) and Airbnb. Commands integrate with symbol servers and debuggers like GDB and build systems such as Autotools and CMake.
Perf exposes events mapped to hardware PMU counters (e.g., cycles, instructions, cache-references) and software events like context-switches and page-faults. Vendors such as Intel publish event catalogs (e.g., uncore, frontend bound) while ARM Limited provides event encodings for Cortex series cores. Metrics reported by perf are often cross-referenced with telemetry systems such as Grafana dashboards maintained by operations teams from Spotify and Slack Technologies.
The perf toolchain integrates with ecosystems including BPF Compiler Collection, bcc (software), and higher-level profilers like FlameGraph visualization created by Brendan Gregg. Integration points exist for container orchestration with Docker and Kubernetes (software), and CI/CD pipelines used by GitHub Actions and Jenkins. Third-party GUIs and post-processing utilities from vendors like Intel and projects such as SystemTap enhance perf workflows for large-scale deployments at enterprises like IBM and Cisco Systems.
Perf's kernel-level access requires elevated privileges, making its use regulated by distributions such as Red Hat Enterprise Linux and policies at organizations like NASA and Department of Defense (United States). Misuse can expose sensitive symbol information or enable side-channel analysis exploited in academic research published by institutions like University of California, Berkeley and MIT. Limitations include varying PMU availability across CPU models from Intel Corporation and Advanced Micro Devices, potential overhead in high-frequency sampling, and reduced visibility inside hardened or virtualized environments managed by VMware and Xen (hypervisor). Administrators mitigate risks with kernel options, seccomp filters used by Google and sandboxing strategies in Firefox and Chromium.
Category:Linux performance analysis tools