Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(12452)

Issue 1683046: Make -ftime-report produce a coarse breakdown of compilation phases (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 10 months ago by Reid Kleckner
Modified:
13 years, 9 months ago
Reviewers:
CC:
cfe-commits_cs.uiuc.edu
Base URL:
http://llvm.org/svn/llvm-project/cfe/trunk/
Visibility:
Public.

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

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+180 lines, -56 lines) Patch
A include/clang/Basic/PhaseTimeInfo.h View 1 chunk +80 lines, -0 lines 0 comments Download
M include/clang/Lex/Preprocessor.h View 1 chunk +2 lines, -0 lines 0 comments Download
M include/clang/Parse/Parser.h View 6 chunks +12 lines, -0 lines 0 comments Download
M include/clang/Sema/ParseAST.h View 1 chunk +2 lines, -1 line 0 comments Download
A lib/Basic/PhaseTimeInfo.cpp View 1 chunk +27 lines, -0 lines 0 comments Download
M lib/CodeGen/BackendUtil.cpp View 6 chunks +8 lines, -5 lines 0 comments Download
M lib/CodeGen/CodeGenAction.cpp View 4 chunks +7 lines, -19 lines 0 comments Download
M lib/Frontend/FrontendAction.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M lib/Sema/ParseAST.cpp View 3 chunks +40 lines, -30 lines 0 comments Download

Messages

Total messages: 3
Reid Kleckner
Please take a look.
13 years, 10 months ago (2010-06-19 00:13:32 UTC) #1
daniel_zuster.org
Hi Reid, I don't see any changes in Preprocessor.h other than to add #includes, was ...
13 years, 10 months ago (2010-06-23 05:24:07 UTC) #2
Reid Kleckner
13 years, 10 months ago (2010-06-23 21:23:12 UTC) #3
On Tue, Jun 22, 2010 at 10:24 PM, Daniel Dunbar <daniel@zuster.org> wrote:
> Hi Reid,
>
> I don't see any changes in Preprocessor.h other than to add #includes,
> was that intentional?

No, that can be discarded.

> Have you measured the impact of your changes on performance? I suspect
> that is going to be prohibitive...

Times for building a debug llvm+clang with a Release-Asserts clang,
without -ftime-report enabled:

Trunk:
real	5m53.240s
user	20m7.335s
sys	1m33.862s

With timers:
real	5m57.742s
user	20m20.052s
sys	1m34.406s

So, it's a 1.25% slowdown.  I don't know if that's in the noise margin
or not.  I didn't repeat the experiment because it takes 12 minutes
and I can't do any other major computational tasks while it's running.

One other drawback to this whole approach is that I'm missing ~17% of
the time spent in the clang -cc1 invocation, and I can't find where
it's coming from.  It may be better to use oprofile or some other
profile and try to break the output of that down by what directory the
source file came from.  I'm not sure how inlining interacts with what
function oprofile assigns the cost to, though, so that may misreport
the costs for the inlined lexing and preprocessing calls.

Reid
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b