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:170

Method Overview

  • public static void ConstructTimerLists()
  • public TimerGroup(llvm::StringRef Name, llvm::StringRef Description)
  • public TimerGroup(llvm::StringRef Name, llvm::StringRef Description, const StringMap<llvm::TimeRecord> & Records)
  • public static std::unique_ptr<TimerGroup> aquireDefaultGroup()
  • public void clear()
  • public static void clearAll()
  • 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)
  • public const char * printJSONValues(llvm::raw_ostream & OS, const char * delim)
  • public void setName(llvm::StringRef NewName, llvm::StringRef NewDescription)
  • public ~TimerGroup()

Methods

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:232

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

Declared at: llvm/include/llvm/Support/Timer.h:197

Parameters

llvm::StringRef Name
llvm::StringRef Description

TimerGroup(
    llvm::StringRef Name,
    llvm::StringRef Description,
    const StringMap<llvm::TimeRecord>& Records)

Declared at: llvm/include/llvm/Support/Timer.h:199

Parameters

llvm::StringRef Name
llvm::StringRef Description
const StringMap<llvm::TimeRecord>& Records

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:236

void clear()

Description

Clear all timers in this group.

Declared at: llvm/include/llvm/Support/Timer.h:214

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:222

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:211

Parameters

llvm::raw_ostream& OS
bool ResetAfterPrint = false

static void printAll(llvm::raw_ostream& OS)

Description

This static method prints all timers.

Declared at: llvm/include/llvm/Support/Timer.h:217

Parameters

llvm::raw_ostream& OS

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:227

Parameters

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:224

Parameters

llvm::raw_ostream& OS
const char* delim

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

Declared at: llvm/include/llvm/Support/Timer.h:204

Parameters

llvm::StringRef NewName
llvm::StringRef NewDescription

~TimerGroup()

Declared at: llvm/include/llvm/Support/Timer.h:202