class TimerGroup
Declaration
class TimerGroup { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/Support/Timer.h:175
Member Variables
- private std::string Name
- private std::string Description
- private llvm::Timer* FirstTimer = nullptr
- First timer in the group.
- private std::vector<PrintRecord> TimersToPrint
- private llvm::TimerGroup** Prev
- Pointer to Next field of previous timergroup in list.
- private llvm::TimerGroup* Next
- Pointer to next timergroup in list.
Method Overview
- public static void ConstructTimerLists()
- private void PrintQueuedTimers(llvm::raw_ostream & OS)
- public TimerGroup(llvm::StringRef Name, llvm::StringRef Description)
- public TimerGroup(llvm::StringRef Name, llvm::StringRef Description, const StringMap<llvm::TimeRecord> & Records)
- private TimerGroup(const llvm::TimerGroup & TG)
- private void addTimer(llvm::Timer & T)
- public static std::unique_ptr<TimerGroup> aquireDefaultGroup()
- public void clear()
- public static void clearAll()
- private void prepareToPrintList(bool reset_time = false)
- public void print(llvm::raw_ostream & OS, bool ResetAfterPrint = false)
- public static void printAll(llvm::raw_ostream & OS)
- public static const char * printAllJSONValues(llvm::raw_ostream & OS, const char * delim)
- private void printJSONValue(llvm::raw_ostream & OS, const llvm::TimerGroup::PrintRecord & R, const char * suffix, double Value)
- public const char * printJSONValues(llvm::raw_ostream & OS, const char * delim)
- private void removeTimer(llvm::Timer & T)
- public void setName(llvm::StringRef NewName, llvm::StringRef NewDescription)
- public ~TimerGroup()
Methods
¶static void ConstructTimerLists()
static void ConstructTimerLists()
Description
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.
Declared at: llvm/include/llvm/Support/Timer.h:237
¶void PrintQueuedTimers(llvm::raw_ostream& OS)
void PrintQueuedTimers(llvm::raw_ostream& OS)
Declared at: llvm/include/llvm/Support/Timer.h:249
Parameters
¶TimerGroup(llvm::StringRef Name,
llvm::StringRef Description)
TimerGroup(llvm::StringRef Name,
llvm::StringRef Description)
Declared at: llvm/include/llvm/Support/Timer.h:202
Parameters
- llvm::StringRef Name
- llvm::StringRef Description
¶TimerGroup(
llvm::StringRef Name,
llvm::StringRef Description,
const StringMap<llvm::TimeRecord>& Records)
TimerGroup(
llvm::StringRef Name,
llvm::StringRef Description,
const StringMap<llvm::TimeRecord>& Records)
Declared at: llvm/include/llvm/Support/Timer.h:204
Parameters
- llvm::StringRef Name
- llvm::StringRef Description
- const StringMap<llvm::TimeRecord>& Records
¶TimerGroup(const llvm::TimerGroup& TG)
TimerGroup(const llvm::TimerGroup& TG)
Declared at: llvm/include/llvm/Support/Timer.h:198
Parameters
- const llvm::TimerGroup& TG
¶void addTimer(llvm::Timer& T)
void addTimer(llvm::Timer& T)
Declared at: llvm/include/llvm/Support/Timer.h:246
Parameters
- llvm::Timer& T
¶static std::unique_ptr<TimerGroup>
aquireDefaultGroup()
static std::unique_ptr<TimerGroup>
aquireDefaultGroup()
Description
This makes the default group unmanaged, and lets the user manage the group's lifetime.
Declared at: llvm/include/llvm/Support/Timer.h:241
¶void clear()
void clear()
Description
Clear all timers in this group.
Declared at: llvm/include/llvm/Support/Timer.h:219
¶static void clearAll()
static void clearAll()
Description
Clear out all timers. This is mostly used to disable automatic printing on shutdown, when timers have already been printed explicitly using \c printAll or \c printJSONValues.
Declared at: llvm/include/llvm/Support/Timer.h:227
¶void prepareToPrintList(bool reset_time = false)
void prepareToPrintList(bool reset_time = false)
Declared at: llvm/include/llvm/Support/Timer.h:248
Parameters
- bool reset_time = false
¶void print(llvm::raw_ostream& OS,
bool ResetAfterPrint = false)
void print(llvm::raw_ostream& OS,
bool ResetAfterPrint = false)
Description
Print any started timers in this group, optionally resetting timers after printing them.
Declared at: llvm/include/llvm/Support/Timer.h:216
Parameters
- llvm::raw_ostream& OS
- bool ResetAfterPrint = false
¶static void printAll(llvm::raw_ostream& OS)
static void printAll(llvm::raw_ostream& OS)
Description
This static method prints all timers.
Declared at: llvm/include/llvm/Support/Timer.h:222
Parameters
¶static const char* printAllJSONValues(
llvm::raw_ostream& OS,
const char* delim)
static const char* printAllJSONValues(
llvm::raw_ostream& OS,
const char* delim)
Description
Prints all timers as JSON key/value pairs.
Declared at: llvm/include/llvm/Support/Timer.h:232
Parameters
- llvm::raw_ostream& OS
- const char* delim
¶void printJSONValue(
llvm::raw_ostream& OS,
const llvm::TimerGroup::PrintRecord& R,
const char* suffix,
double Value)
void printJSONValue(
llvm::raw_ostream& OS,
const llvm::TimerGroup::PrintRecord& R,
const char* suffix,
double Value)
Declared at: llvm/include/llvm/Support/Timer.h:250
Parameters
- llvm::raw_ostream& OS
- const llvm::TimerGroup::PrintRecord& R
- const char* suffix
- double Value
¶const char* printJSONValues(llvm::raw_ostream& OS,
const char* delim)
const char* printJSONValues(llvm::raw_ostream& OS,
const char* delim)
Declared at: llvm/include/llvm/Support/Timer.h:229
Parameters
- llvm::raw_ostream& OS
- const char* delim
¶void removeTimer(llvm::Timer& T)
void removeTimer(llvm::Timer& T)
Declared at: llvm/include/llvm/Support/Timer.h:247
Parameters
- llvm::Timer& T
¶void setName(llvm::StringRef NewName,
llvm::StringRef NewDescription)
void setName(llvm::StringRef NewName,
llvm::StringRef NewDescription)
Declared at: llvm/include/llvm/Support/Timer.h:209
Parameters
- llvm::StringRef NewName
- llvm::StringRef NewDescription
¶~TimerGroup()
~TimerGroup()
Declared at: llvm/include/llvm/Support/Timer.h:207