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). | ![]() |
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. |