LLVM
8.0.1
|
The TimerGroup class is used to group together related timers into a single report that is printed when the TimerGroup is destroyed. More...
#include "llvm/Support/Timer.h"
Public Member Functions | |
TimerGroup (StringRef Name, StringRef Description) | |
TimerGroup (StringRef Name, StringRef Description, const StringMap< TimeRecord > &Records) | |
~TimerGroup () | |
void | setName (StringRef NewName, StringRef NewDescription) |
void | print (raw_ostream &OS) |
Print any started timers in this group. More... | |
void | clear () |
Clear all timers in this group. More... | |
const char * | printJSONValues (raw_ostream &OS, const char *delim) |
Static Public Member Functions | |
static void | printAll (raw_ostream &OS) |
This static method prints all timers. More... | |
static void | clearAll () |
Clear out all timers. More... | |
static const char * | printAllJSONValues (raw_ostream &OS, const char *delim) |
Prints all timers as JSON key/value pairs. More... | |
static void | ConstructTimerLists () |
Ensure global timer group lists are initialized. More... | |
Friends | |
class | Timer |
void | PrintStatisticsJSON (raw_ostream &OS) |
Print statistics in JSON format. More... | |
The TimerGroup class is used to group together related timers into a single report that is printed when the TimerGroup is destroyed.
It is illegal to destroy a TimerGroup object before all of the Timers in it are gone. A TimerGroup can be specified for a newly created timer in its constructor.
Definition at line 227 of file Timer.cpp.
References TimerGroupList.
|
explicit |
Definition at line 239 of file Timer.cpp.
References assert(), P, and llvm::StringMapImpl::size().
TimerGroup::~TimerGroup | ( | ) |
Definition at line 248 of file Timer.cpp.
References llvm::CreateInfoOutputFile(), llvm::format(), getDefaultTimerGroup(), llvm::TimeRecord::getMemUsed(), llvm::TimeRecord::getProcessTime(), llvm::TimeRecord::getSystemTime(), llvm::TimeRecord::getUserTime(), llvm::TimeRecord::getWallTime(), llvm::Timer::hasTriggered(), llvm::raw_ostream::indent(), llvm::Timer::isRunning(), llvm::make_range(), llvm::TimeRecord::print(), llvm::Record::print(), llvm::sort(), llvm::Timer::startTimer(), llvm::Timer::stopTimer(), and T.
void TimerGroup::clear | ( | ) |
Clear all timers in this group.
Definition at line 370 of file Timer.cpp.
References llvm::Timer::clear(), and T.
|
static |
Clear out all timers.
This is mostly used to disable automatic printing on shutdown, when timers have already been printed explicitly using printAll
or printJSONValues
.
Definition at line 383 of file Timer.cpp.
References assert(), llvm::format(), and llvm::None.
|
static |
Ensure global timer group lists are initialized.
This function is mostly used by the Statistic code to influence the construction and destruction order of the global timer lists.
Definition at line 430 of file Timer.cpp.
Referenced by llvm::Statistic::RegisterStatistic().
void TimerGroup::print | ( | raw_ostream & | OS | ) |
Print any started timers in this group.
Definition at line 360 of file Timer.cpp.
Referenced by llvm::TimePassesHandler::print().
|
static |
|
static |
Prints all timers as JSON key/value pairs.
Definition at line 423 of file Timer.cpp.
Referenced by llvm::PrintStatisticsJSON().
const char * TimerGroup::printJSONValues | ( | raw_ostream & | OS, |
const char * | delim | ||
) |
Definition at line 400 of file Timer.cpp.
References llvm::TimeRecord::getMemUsed(), llvm::TimeRecord::getSystemTime(), llvm::TimeRecord::getUserTime(), and llvm::TimeRecord::getWallTime().
Definition at line 204 of file Timer.h.
References llvm::StringRef::begin(), clear(), llvm::StringRef::end(), and llvm::TimeRecord::print().
|
friend |
Print statistics in JSON format.
This does include all global timers (