From 210f5a28227c90d739298e3e6729e827858fe397 Mon Sep 17 00:00:00 2001 From: Anna Zaks Date: Mon, 27 Aug 2012 18:38:32 +0000 Subject: [PATCH] [analyzer] More internal stats collection. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162687 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../Core/ExprEngineCallAndReturn.cpp | 5 +++++ utils/analyzer/SumTimerInfo.py | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp b/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp index 6529b84c4b..4ce434d198 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp @@ -28,6 +28,9 @@ using namespace ento; STATISTIC(NumOfDynamicDispatchPathSplits, "The # of times we split the path due to imprecise dynamic dispatch info"); +STATISTIC(NumInlinedCalls, + "The # of times we inlined a call"); + void ExprEngine::processCallEnter(CallEnter CE, ExplodedNode *Pred) { // Get the entry block in the CFG of the callee. const StackFrameContext *calleeCtx = CE.getCalleeContext(); @@ -442,6 +445,8 @@ bool ExprEngine::inlineCall(const CallEvent &Call, const Decl *D, // added onto the work list so remove it from the node builder. Bldr.takeNodes(Pred); + NumInlinedCalls++; + return true; } diff --git a/utils/analyzer/SumTimerInfo.py b/utils/analyzer/SumTimerInfo.py index a6731bb8f2..4ef1ceb4ce 100644 --- a/utils/analyzer/SumTimerInfo.py +++ b/utils/analyzer/SumTimerInfo.py @@ -28,6 +28,8 @@ if __name__ == '__main__': ReachableBlocks = 0 ReachedMaxSteps = 0 NumSteps = 0 + NumInlinedCallSites = 0 + NumBifurcatedCallSites = 0 MaxCFGSize = 0 Mode = 1 for line in f: @@ -39,25 +41,31 @@ if __name__ == '__main__': Count = Count + 1 if (float(s[6]) > MaxTime) : MaxTime = float(s[6]) - if ((("warning generated." in line) or ("warnings generated." in line)) and Mode == 1) : + if ((("warning generated." in line) or ("warnings generated" in line)) and Mode == 1) : s = line.split() Warnings = Warnings + int(s[0]) - if (("The # of functions analysed (as top level)." in line) and (Mode == 1)) : + if (("The # of functions analysed (as top level)" in line) and (Mode == 1)) : s = line.split() FunctionsAnalyzed = FunctionsAnalyzed + int(s[0]) if (("The % of reachable basic blocks" in line) and (Mode == 1)) : s = line.split() ReachableBlocks = ReachableBlocks + int(s[0]) - if (("The # of times we reached the max number of steps." in line) and (Mode == 1)) : + if (("The # of times we reached the max number of steps" in line) and (Mode == 1)) : s = line.split() ReachedMaxSteps = ReachedMaxSteps + int(s[0]) if (("The maximum number of basic blocks in a function" in line) and (Mode == 1)) : s = line.split() if (MaxCFGSize < int(s[0])) : MaxCFGSize = int(s[0]) - if (("The # of steps executed." in line) and (Mode == 1)) : + if (("The # of steps executed" in line) and (Mode == 1)) : s = line.split() NumSteps = NumSteps + int(s[0]) + if (("The # of times we inlined a call" in line) and (Mode == 1)) : + s = line.split() + NumInlinedCallSites = NumInlinedCallSites + int(s[0]) + if (("The # of times we split the path due to imprecise dynamic dispatch info" in line) and (Mode == 1)) : + s = line.split() + NumBifurcatedCallSites = NumBifurcatedCallSites + int(s[0]) if ((") Total" in line) and (Mode == 1)) : s = line.split() TotalTime = TotalTime + float(s[6]) @@ -69,6 +77,7 @@ if __name__ == '__main__': print "Reachable Blocks %d" % (ReachableBlocks) print "Reached Max Steps %d" % (ReachedMaxSteps) print "Number of Steps %d" % (NumSteps) + print "Number of Inlined calls %d (bifurcated %d)" % (NumInlinedCallSites, NumBifurcatedCallSites) print "MaxTime %f" % (MaxTime) print "TotalTime %f" % (TotalTime) print "Max CFG Size %d" % (MaxCFGSize) -- 2.40.0