[LNT] r264523 - [cPerf] If a symbol takes up less than 0.5% of the total time, abandon it

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 26 16:01:12 PDT 2016


Author: jamesm
Date: Sat Mar 26 18:01:11 2016
New Revision: 264523

URL: http://llvm.org/viewvc/llvm-project?rev=264523&view=rev
Log:
[cPerf] If a symbol takes up less than 0.5% of the total time, abandon it

This avoids us creating absolutely gigantic profiles for some testcases, like LLVM.

Modified:
    lnt/trunk/lnt/testing/profile/cPerf.cpp

Modified: lnt/trunk/lnt/testing/profile/cPerf.cpp
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/testing/profile/cPerf.cpp?rev=264523&r1=264522&r2=264523&view=diff
==============================================================================
--- lnt/trunk/lnt/testing/profile/cPerf.cpp (original)
+++ lnt/trunk/lnt/testing/profile/cPerf.cpp Sat Mar 26 18:01:11 2016
@@ -595,6 +595,15 @@ void PerfReader::emitFunctionStart(std::
 
 void PerfReader::emitFunctionEnd(std::string &Name,
                                  std::map<const char *, uint64_t> &Counters) {
+  // If the function only took up < 0.5% of any counter, don't bother with it.
+  bool Keep = false;
+  for (auto &KV : Counters) {
+    if ((double)KV.second / (double)TotalEvents[KV.first] > 0.005)
+      Keep = true;
+  }
+  if (!Keep)
+    return;
+
   auto *CounterDict = PyDict_New();
   for (auto &KV : Counters)
     PyDict_SetItemString(CounterDict, KV.first,




More information about the llvm-commits mailing list