[cfe-commits] Make -ftime-report produce a coarse breakdown of compilation phases (issue1683046)

reid.kleckner at gmail.com reid.kleckner at gmail.com
Fri Jun 18 17:13:33 PDT 2010


Reviewers: ,

Message:
Please take a look.

Description:
I'm adding this because I would like to use it to profile clang over
large project builds.  My plan is to thread -ftime-report through the
build system and write a script to aggregate the output.

Output looks like this for a hello world test case:

$ Debug/bin/clang -ftime-report t.c -c -o t.o
...

===-------------------------------------------------------------------------===
                             Compilation phase timers
===-------------------------------------------------------------------------===
   Total Execution Time: 0.0360 seconds (0.0497 wall clock)

    ---User Time---   --User+System--   ---Wall Time---  --- Name ---
    0.0160 ( 44.4%)   0.0160 ( 44.4%)   0.0198 ( 39.8%)  Parsing and Sema
Time
    0.0120 ( 33.3%)   0.0120 ( 33.3%)   0.0187 ( 37.6%)  Lexing and
Preprocessing Time
    0.0040 ( 11.1%)   0.0040 ( 11.1%)   0.0071 ( 14.4%)  Machine Code
Generation Time
    0.0000 (  0.0%)   0.0000 (  0.0%)   0.0029 (  5.8%)  LLVM IR
Generation Time
    0.0040 ( 11.1%)   0.0040 ( 11.1%)   0.0012 (  2.5%)  LLVM IR
Optimization Time
    0.0360 (100.0%)   0.0360 (100.0%)   0.0497 (100.0%)  Total


Please review this at http://codereview.appspot.com/1683046/show

Affected files:
   A     include/clang/Basic/PhaseTimeInfo.h
   M     include/clang/Lex/Preprocessor.h
   M     include/clang/Parse/Parser.h
   M     include/clang/Sema/ParseAST.h
   A     lib/Basic/PhaseTimeInfo.cpp
   M     lib/CodeGen/BackendUtil.cpp
   M     lib/CodeGen/CodeGenAction.cpp
   M     lib/Frontend/FrontendAction.cpp
   M     lib/Sema/ParseAST.cpp





More information about the cfe-commits mailing list