statistical profiling of gcc
David Morrison
dave@bnl.gov
Wed Feb 19 19:56:00 GMT 2003
Hi all,
I'm sure something like this must have been tried before, but on the
off-change it hasn't, I hacked in a line or two to gcc/main.c to set up
"jprof" to do statistical profiling on gcc runs. Here's a link to info
on jprof:
http://lxr.mozilla.org/mozilla/source/tools/jprof/README.html
It provides fairly detailed information that I've found useful on other
projects for diagnosing CPU usage hotspots. I used the resulting
compiler to compile gcc/expr.o - for no particularly good reason, just a
nice big file - with and without optimization. The full results can be
found here:
http://www.phenix.bnl.gov/~dave/gcc/expr_opt.html
and here:
http://www.phenix.bnl.gov/~dave/gcc/expr_noopt.html
The first part of the "flat" profile is shown below. The interrupt was
set for 1 ms and the "Count" should be roughly proportional to CPU time
spent in that routine. The full report has a lot more information.
Count Function Name
750 seen_objects
497 htab_traverse
279 ggc_set_mark
190 count_or_remove_death_notes
148 clear_table
139 compute_transp
117 verify_flow_info
95 ggc_alloc
95 side_effects_p
90 for_each_rtx
90 gt_ggc_mx_lang_tree_node
81 varray_clear
77 constrain_operands
77 sbitmap_vector_alloc
72 subst_reloads
69 gt_ggc_mx_rtx_def
Useful?
Dave
More information about the Gcc
mailing list