43 cl::desc(
"Enable statistics output from program (available with Asserts)"));
47 cl::desc(
"Display statistics as json data"));
57 std::vector<const Statistic*>
Stats;
96 StatisticInfo::StatisticInfo() {
102 StatisticInfo::~StatisticInfo() {
116 void StatisticInfo::sort() {
133 unsigned MaxDebugTypeLen = 0, MaxValLen = 0;
134 for (
size_t i = 0, e = Stats.Stats.size();
i != e; ++
i) {
135 MaxValLen = std::max(MaxValLen,
136 (
unsigned)
utostr(Stats.Stats[
i]->getValue()).size());
137 MaxDebugTypeLen = std::max(MaxDebugTypeLen,
138 (
unsigned)std::strlen(Stats.Stats[
i]->getDebugType()));
144 OS <<
"===" << std::string(73,
'-') <<
"===\n"
145 <<
" ... Statistics Collected ...\n"
146 <<
"===" << std::string(73,
'-') <<
"===\n\n";
149 for (
size_t i = 0, e = Stats.Stats.size();
i != e; ++
i)
150 OS <<
format(
"%*u %-*s - %s\n",
151 MaxValLen, Stats.Stats[
i]->getValue(),
152 MaxDebugTypeLen, Stats.Stats[
i]->getDebugType(),
153 Stats.Stats[
i]->getDesc());
166 const char *delim =
"";
167 for (
const Statistic *Stat : Stats.Stats) {
170 "Statistic group/type name is simple.");
177 TimerGroup::printAllJSONValues(OS, delim);
184 #if !defined(NDEBUG) || defined(LLVM_ENABLE_STATS)
188 if (Stats.Stats.empty())
return;
204 (*OutStream) <<
"Statistics are disabled. "
205 <<
"Build with asserts or with -DLLVM_ENABLE_STATS\n";
void EnableStatistics(bool PrintOnExit=true)
Enable the collection and printing of statistics.
static cl::opt< bool > StatsAsJSON("stats-json", cl::desc("Display statistics as json data"))
void RegisterStatistic()
RegisterStatistic - The first time a statistic is bumped, this method is called.
bool needsQuotes(StringRef S)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with strcmp
static cl::opt< bool > Stats("stats", cl::desc("Enable statistics output from program (available with Asserts)"))
-stats - Command line option to cause transformations to emit stats about what they did...
const char * getDebugType() const
static ManagedStatic< StatisticInfo > StatInfo
static std::string utostr(uint64_t X, bool isNeg=false)
std::unique_ptr< raw_fd_ostream > CreateInfoOutputFile()
Return a file stream to print our output on.
format_object< Ts...> format(const char *Fmt, const Ts &...Vals)
These are helper functions used to produce formatted output.
#define TsanHappensBefore(cv)
void PrintStatisticsJSON(raw_ostream &OS)
Print statistics in JSON format.
#define TsanIgnoreWritesBegin()
#define TsanIgnoreWritesEnd()
const char * getDesc() const
unsigned getValue() const
const char * getName() const
void PrintStatistics()
Print statistics to the file returned by CreateInfoOutputFile().
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static void ConstructTimerLists()
Ensure global timer group lists are initialized.
This class implements an extremely fast bulk output stream that can only output to a stream...
ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...
static ManagedStatic< sys::SmartMutex< true > > StatLock
bool AreStatisticsEnabled()
Check if statistics are enabled.