LLVM 20.0.0git
|
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, bool ResetAfterPrint=false) |
Print any started timers in this group, optionally resetting timers after printing them. | |
void | clear () |
Clear all timers in this group. | |
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. | |
static void | clearAll () |
Clear out all timers. | |
static const char * | printAllJSONValues (raw_ostream &OS, const char *delim) |
Prints all timers as JSON key/value pairs. | |
static void | constructForStatistics () |
Ensure global objects required for statistics printing are initialized. | |
static void * | acquireTimerGlobals () |
This makes the timer globals unmanaged, and lets the user manage the lifetime. | |
Friends | |
class | TimerGlobals |
class | Timer |
void | PrintStatisticsJSON (raw_ostream &OS) |
Print statistics in JSON format. | |
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.
|
explicit |
TimerGroup::~TimerGroup | ( | ) |
Definition at line 281 of file Timer.cpp.
References timerLock().
|
static |
This makes the timer globals unmanaged, and lets the user manage the lifetime.
Definition at line 550 of file Timer.cpp.
References ManagedTimerGlobals.
void TimerGroup::clear | ( | ) |
|
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 423 of file Timer.cpp.
References TimerGroupList, and timerLock().
|
static |
Ensure global objects required for statistics printing are initialized.
This function is used by the Statistic code to ensure correct order of global constructors and destructors.
Definition at line 546 of file Timer.cpp.
References ManagedTimerGlobals.
void TimerGroup::print | ( | raw_ostream & | OS, |
bool | ResetAfterPrint = false |
||
) |
Print any started timers in this group, optionally resetting timers after printing them.
Definition at line 398 of file Timer.cpp.
References OS, and timerLock().
Referenced by llvm::TimePassesHandler::print().
|
static |
This static method prints all timers.
Definition at line 416 of file Timer.cpp.
References OS, TimerGroupList, and timerLock().
|
static |
Prints all timers as JSON key/value pairs.
Definition at line 467 of file Timer.cpp.
References OS, TimerGroupList, and timerLock().
Referenced by llvm::PrintStatisticsJSON().
const char * TimerGroup::printJSONValues | ( | raw_ostream & | OS, |
const char * | delim | ||
) |
Definition at line 440 of file Timer.cpp.
References OS, and timerLock().
Definition at line 216 of file Timer.h.
References llvm::StringRef::begin(), llvm::StringRef::end(), and Name.
|
friend |
Print statistics in JSON format.
This does include all global timers (
|
friend |