• 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

gprof: command not found

by admin

The standard GNU profiler, gprof, is available for most Unix-like systems. gprof is part of the GNU toolchain and was one of the earliest open source code-profiling tools. It combines compile-time instrumentation and sampling techniques, using a 100 Hz sample rate. It has the advantage that it does not require kernel support.

To prepare a program for profiling with gprof, you add -pg to the compile and link flags, which injects code that collects information about the call tree into the function preamble. When you run the program, samples are collected and stored in a buffer, which is written to a file named gmon.out when the program terminates.

if you encounter below error while running the gprof command:


you may try installing the binutils package as show below as per your choice of distribution.

Distribution Command
OS X brew install binutils
Debian apt-get install binutils
Ubuntu apt-get install binutils
Alpine apk add binutils
Arch Linux pacman -S binutils
Kali Linux apt-get install binutils
CentOS yum install binutils
Fedora dnf install binutils
Raspbian apt-get install binutils

gprof displays the profile data for an object file. The file’s symbol table is compared with the call graph profile file gmon.out (previously created by compiling with gcc -pg). Many of gprof’s options take a symbol-specification argument, or symspec, to limit the option to specified files or functions. The symspec may be a filename, a function, or a line number. It can also be given as filename:function or filename:linenumber to specify a function or line number in a specific file. gprof expects filenames to contain a period and functions to not contain a period.

Filed Under: Linux

Some more articles you might also be interested in …

  1. ufw Command Options
  2. How to use command line shell functions in Linux
  3. Permission Table for a File/Directory And File System Users Types
  4. avrdude: Driver program for Atmel AVR microcontrollers programming (Command Examples)
  5. loadtest Command Examples
  6. smartctl: command not found
  7. dvc destroy: Remove all DVC files and directories from a DVC project
  8. mountpoint: command not found
  9. equery Command Examples in Gentoo Linux
  10. pmount Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright