gprof is used to profile a C program. Profiling gives performance information about the subroutine/function usage of the program when it runs on a set of data.