Generated by GPT-5-mini| GNU gprof | |
|---|---|
| Name | GNU gprof |
| Developer | GNU Project |
| Released | 1982 |
| Operating system | Unix-like |
| License | GNU General Public License |
GNU gprof GNU gprof is a performance analysis tool for programs producing execution profiles on Unix-like systems. It integrates with compilers and runtime environments used by projects under the aegis of the Free Software Foundation and has been referenced in discussions involving software performance in contexts such as Linux kernel, Glibc, GNU Compiler Collection, X Window System, GNU Emacs, and Apache HTTP Server. Developers from organizations including Sun Microsystems, Silicon Graphics, IBM, HP, Intel, and Red Hat have employed or critiqued gprof in relation to profiling needs for production software like OpenSolaris, AIX, HP-UX, and BSD variants.
gprof provides statistical and call-graph profiling for executables built with compatible compilers such as GCC and linkers common in Unix toolchains. It combines sampling-based measurement tied to system timer interrupts with instrumentation inserted at compile or link time, similar in purpose to tools used by teams at Google, Facebook, Microsoft Research, Apple Inc., and NVIDIA for performance tuning. The tool produces human-readable summaries of function execution time, call counts, and call relationships that have been used in projects like OpenOffice, LibreOffice, Mozilla Firefox, Chromium, and various embedded systems initiatives.
Origins of profiling trace back to research at institutions such as Bell Labs, MIT, Stanford University, and Carnegie Mellon University where sampling and instrumentation techniques were explored in academic projects like Unix and Multics. gprof itself evolved from profiling tools developed in the 1970s and 1980s and was incorporated into the toolchain promoted by the GNU Project and the Free Software Foundation. Key contributors included engineers connected to the GNU Compiler Collection and maintainers in distributions such as Debian, Gentoo, Arch Linux, Fedora, and OpenSUSE. The tool’s development intersected with initiatives at DARPA, collaboration with hardware vendors like AMD and ARM Limited, and performance research presented at venues such as USENIX, ACM SIGPLAN, ACM SIGARCH, and IEEE conferences.
gprof offers features that reflect both historic and contemporary profiling paradigms: sampling via interval timers (present in POSIX systems), function-level call-graph generation, flat-profile summaries, and annotated source support when debug symbols are present as produced by compilers like GCC and linkers used in binutils. It reports metrics such as time spent per function, call counts, and caller-callee relationships used by teams maintaining large codebases including KDE, GNOME, MariaDB, PostgreSQL, MySQL, SQLite, Nginx, and Lighttpd. gprof’s instrumentation model inspired or complements other profiling systems created by groups at Intel Corporation, Oracle Corporation, Qualcomm, Broadcom, and research labs at University of California, Berkeley, University of Cambridge, ETH Zurich, and University of Illinois Urbana-Champaign.
Typical usage requires compiling programs with a profiling flag supported by compilers such as GCC or legacy compilers used at SGI and Cray, linking to produce instrumented executables, running workloads representative of production scenarios such as those used by projects like Apache HTTP Server or Nginx, and invoking gprof to analyze the generated profiling data—an approach parallel to profiling practices at Netflix, Amazon Web Services, Dropbox, and Spotify. Workflows often integrate gprof output into performance tuning cycles alongside benchmarking suites like SPEC CPU, LINPACK, Phoronix Test Suite, and tracing tools from SystemTap or DTrace used in Solaris and FreeBSD environments.
gprof produces text-based reports with a flat profile and a call-graph that list functions, cumulative times, self times, call counts, and call graph arcs; these have been parsed or visualized by third-party tools and GUIs developed by communities around Eclipse Foundation, KDevelop, KCacheGrind, Qt Creator, Visual Studio Code, and Emacs. Outputs rely on symbol information managed by tools like objdump and readelf from binutils, and integration with debugging formats such as DWARF facilitates mapping to source code for projects maintained at GitHub, GitLab, Bitbucket, and enterprise repositories at Perforce.
gprof’s limitations have been widely discussed in literature and practitioner forums such as Stack Overflow, LWN.net, and academic papers presented at USENIX, IEEE/ACM conferences. Criticisms include imprecision from sampling versus instrumentation trade-offs (issues examined at ACM SIGMETRICS), difficulty profiling multithreaded programs common in modern systems like OpenMP-based applications and POSIX threads-using services, interference with optimizations performed by GCC and link-time optimization used in projects like Chromium and Firefox, and challenges with inlining, tail-call elimination, and dynamic languages used in Python-based or Node.js-based services. Vendors such as Intel and AMD have promoted hardware-assisted profilers to address sampling fidelity, while cloud providers like Google Cloud Platform and Amazon Web Services offer distributed tracing alternatives.
Beyond the GNU implementation, an ecosystem of profilers and implementations exists: statistical and instrumentation profilers such as perf from Linux kernel developers, Valgrind’s Callgrind, OProfile, Instruments from Apple Inc., VTune from Intel Corporation, gperftools from Google, FlameGraph tools by Brendan Gregg, Eprof, DTrace from Sun Microsystems/Oracle Corporation, and commercial profilers used at SAP, Oracle, Microsoft, IBM, and HP. Integrations often appear in continuous integration and performance monitoring stacks maintained by teams at Jenkins, Travis CI, GitHub Actions, CircleCI, and Bazel-based build systems.
Category:Performance analysis tools