LLVM  6.0.0svn
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::TimerGroup Class Reference

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 ()
 
void setName (StringRef NewName, StringRef NewDescription)
 
void print (raw_ostream &OS)
 Print any started timers in this group and zero them. More...
 

Static Public Member Functions

static void printAll (raw_ostream &OS)
 This static method prints all timers and clears them all out. More...
 
static const charprintAllJSONValues (raw_ostream &OS, const char *delim)
 Prints all timers as JSON key/value pairs, and clears them all out. 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...
 

Detailed 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.

Definition at line 170 of file Timer.h.

Constructor & Destructor Documentation

◆ TimerGroup()

TimerGroup::TimerGroup ( StringRef  Name,
StringRef  Description 
)
explicit

Definition at line 225 of file Timer.cpp.

References TimerGroupList.

◆ ~TimerGroup()

TimerGroup::~TimerGroup ( )

Member Function Documentation

◆ ConstructTimerLists()

void TimerGroup::ConstructTimerLists ( )
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 394 of file Timer.cpp.

Referenced by llvm::Statistic::RegisterStatistic().

◆ print()

void TimerGroup::print ( raw_ostream OS)

Print any started timers in this group and zero them.

Definition at line 346 of file Timer.cpp.

Referenced by llvm::legacy::PassManagerImpl::getContainedManager().

◆ printAll()

void TimerGroup::printAll ( raw_ostream OS)
static

This static method prints all timers and clears them all out.

Definition at line 356 of file Timer.cpp.

References assert(), llvm::TimeRecord::getSystemTime(), llvm::TimeRecord::getUserTime(), llvm::TimeRecord::getWallTime(), and llvm::yaml::needsQuotes().

◆ printAllJSONValues()

const char * TimerGroup::printAllJSONValues ( raw_ostream OS,
const char delim 
)
static

Prints all timers as JSON key/value pairs, and clears them all out.

Definition at line 387 of file Timer.cpp.

Referenced by llvm::PrintStatisticsJSON().

◆ setName()

void llvm::TimerGroup::setName ( StringRef  NewName,
StringRef  NewDescription 
)
inline

Friends And Related Function Documentation

◆ PrintStatisticsJSON

void PrintStatisticsJSON ( raw_ostream OS)
friend

Print statistics in JSON format.

This does include all global timers (

See also
Timer, TimerGroup). Note that the timers are cleared after printing and will not be printed in human readable form or in a second call of PrintStatisticsJSON().

◆ Timer

friend class Timer
friend

Definition at line 218 of file Timer.h.


The documentation for this class was generated from the following files: