Note, my question is not: how do I tell my compiler to compile with profiling on.
I want to profile my compiles process. For each file, I\'d like to know ho
Try these command line options with g++
-v -ftime-report
That should give you more information on the compiling process. The culprit is usually templates though.
For preprocessing line a bit longer suggestion:
" 0.12 ( 4%) usr 0.06 (12%) sys 1.46 (27%) wall " - this line says, that preprocessing was to do small job on CPU itself (0.12), but is uses system calls rather heavy (0.06 or 50% of user CPU time) and the most time was wasted not on CPU (1.46 real time >> 0.18 s cpu time). So This time was wasted in waiting an I/O operation OR waiting for CPU on busy system. Was this run the only working program on the machine?
For I/O you can do: add noatime to fs to lower number of I/O reqs, buy faster (in terms of lower seek time or higher IO rate) HDD, move clang sources to SSD or even RAM-drive (loop-device). And you can't do a defragment, because it is linux.
For meaning of eash pass, use http://gcc.gnu.org/onlinedocs/gccint/Passes.html#Passes