• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:statistics

1 //===-- Statistic.cpp - Easy way to expose stats information --------------===//
8 //===----------------------------------------------------------------------===//
11 // way to expose various success metrics from passes. These statistics are
12 // printed at the end of a run, when the -stats command line option is enabled
22 //===----------------------------------------------------------------------===//
37 /// -stats - Command line option to cause transformations to emit stats about
43 cl::desc("Enable statistics output from program (available with Asserts)"));
46 static cl::opt<bool> StatsAsJSON("stats-json",
47 cl::desc("Display statistics as json data"));
50 /// StatisticInfo - This class is used in a ManagedStatic so that it is created
52 /// llvm_shutdown is called. We print statistics from the destructor.
59 /// Sort statistics by debugtype,name,description.
73 /// RegisterStatistic - The first time a statistic is bumped, this method is
81 StatInfo->addStatistic(this); in RegisterStatistic()
108 if (int Cmp = std::strcmp(LHS->getDebugType(), RHS->getDebugType())) in sort()
111 if (int Cmp = std::strcmp(LHS->getName(), RHS->getName())) in sort()
114 return std::strcmp(LHS->getDesc(), RHS->getDesc()) < 0; in sort()
125 (unsigned)utostr(Stats.Stats[i]->getValue()).size()); in PrintStatistics()
127 (unsigned)std::strlen(Stats.Stats[i]->getDebugType())); in PrintStatistics()
132 // Print out the statistics header... in PrintStatistics()
133 OS << "===" << std::string(73, '-') << "===\n" in PrintStatistics()
134 << " ... Statistics Collected ...\n" in PrintStatistics()
135 << "===" << std::string(73, '-') << "===\n\n"; in PrintStatistics()
137 // Print all of the statistics. in PrintStatistics()
139 OS << format("%*u %-*s - %s\n", in PrintStatistics()
140 MaxValLen, Stats.Stats[i]->getValue(), in PrintStatistics()
141 MaxDebugTypeLen, Stats.Stats[i]->getDebugType(), in PrintStatistics()
142 Stats.Stats[i]->getDesc()); in PrintStatistics()
164 // Print all of the statistics. in PrintStatisticsJSON()
170 write_json_string_escaped(OS, Stat->getDebugType()); in PrintStatisticsJSON()
172 write_json_string_escaped(OS, Stat->getName()); in PrintStatisticsJSON()
173 OS << "\": " << Stat->getValue(); in PrintStatisticsJSON()
184 // Statistics not enabled? in PrintStatistics()
195 // Check if the -stats option is set instead of checking in PrintStatistics()
196 // !Stats.Stats.empty(). In release builds, Statistics operators in PrintStatistics()
201 (*OutStream) << "Statistics are disabled. " in PrintStatistics()
202 << "Build with asserts or with -DLLVM_ENABLE_STATS\n"; in PrintStatistics()