This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Better timers.
ClosedPublic

Authored by NoQ on Jun 12 2019, 2:04 PM.

Details

Summary

-analyzer-stats now allows you to find out how much time was spent on AST-based analysis and on path-sensitive analysis and, separately, on bug visitors, as they're occasionally a performance problem on their own.

The total timer wasn't useful because there's anyway a total time printed out, so i removed it.

Accidentally remove the ExprEngine's destructor because it's not really useful: reports are flushed manually anyway, which i've noticed while adding a timer.

Sample output:

===-------------------------------------------------------------------------===
                                Analyzer timers
===-------------------------------------------------------------------------===
  Total Execution Time: 7.4278 seconds (7.4293 wall clock)

   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
   7.2345 ( 99.0%)   0.1140 ( 96.9%)   7.3485 ( 98.9%)   7.3500 ( 98.9%)  Path exploration time
   0.0456 (  0.6%)   0.0026 (  2.2%)   0.0482 (  0.6%)   0.0482 (  0.6%)  Path-sensitive report post-processing time
   0.0300 (  0.4%)   0.0011 (  1.0%)   0.0311 (  0.4%)   0.0312 (  0.4%)  Syntax-based analysis time
   7.3101 (100.0%)   0.1177 (100.0%)   7.4278 (100.0%)   7.4293 (100.0%)  Total

Diff Detail

Repository
rL LLVM

Event Timeline

NoQ created this revision.Jun 12 2019, 2:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2019, 2:04 PM
ormris added a subscriber: ormris.Jun 12 2019, 2:08 PM
xazax.hun accepted this revision.Jun 13 2019, 12:32 AM

Looks good :) More diagnostics are always welcome.

This revision is now accepted and ready to land.Jun 13 2019, 12:32 AM
xazax.hun added inline comments.Jun 13 2019, 12:34 AM
clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
228 ↗(On Diff #204353)

Hmm. Maybe add an assert that all the bug reports are flushed at this point? Just to make sure we never need this :) I am not insisting on this change just wondering.

Szelethus accepted this revision.Jun 13 2019, 3:51 AM
NoQ marked an inline comment as done.Jun 19 2019, 4:36 PM
NoQ added inline comments.
clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
228 ↗(On Diff #204353)

Actually we already have the same code in ~BugReporter itself, so this assertion would be kinda trivial. Like, it wouldn't necessarily hold, as the destructor for the field hasn't been executed at this point, but it's still useless, because the destructor will be executed very soon.

xazax.hun added inline comments.Jun 19 2019, 9:36 PM
clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
228 ↗(On Diff #204353)

Makes sense, thanks.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2019, 7:17 PM