Profiling shows where your program spent its time and which functions called which other functions while it was executing. You typically use a profiler when you want to make your program execute faster.

First step in profiling is to compile (and link) your program with profiling options. Such a program will produce profiling data (in binary format) every time it's run. gprof converts these data into text format (follow the ilustration link to see an example). Then comes the interesting part: interpretation.

gprof produces two tables: flat profile (with optional line information) and call graph profile. p-prof shows only the call graph, which I consider the most useful (i.e. I've been too lazy to implement more).

default text profile
profile in p-prof

Main (left) pane of p-prof contains a list of functions, sorted by the time the profiled program spent executing them (shown by the thick bar above function name - red is for time spent in the function itself, magenta for time spent in other functions called from it). The thin bar below the name encodes the number of calls to the function - note that its scale is logarithmic (i.e. functions with three-tickmark bars were called more than a thousand times, four tickmarks means more than ten thousand etc.).

Under the list is an explanation line giving more information about the highlighted entry (including hard numbers). But you don't have to move the mouse all the way down to see the numbers - if you know what they mean, you can read them from a tooltip.

Panes on the right contain entries for functions calling the function selected in the main pane ("Parents" pane) and called from it ("Children" pane). If you double-click a function in a dependent pane, it will be selected in the main pane - that way, you can move up and down the call tree. Clicking the green arrow toolbar button moves the main selection a step back.

You can open a profile file from the menu or pass it to p-prof as a (last) command-line argument. Other command-line arguments include a few standard X options (i.e. -geometry and -font) as well as some p-prof-specific ones (run p-prof -help to see their list). All options may be specified on p-prof command line as well as in a configuration file - system-wide /etc/p-profrc, or user-specific ~/.p-profrc.