#include "llvm/Support/Timer.h"
#include "DebugOptions.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Config/config.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Signposts.h"
#include "llvm/Support/YAMLTraits.h"
#include "llvm/Support/raw_ostream.h"
#include <limits>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_PROC_PID_RUSAGE
#include <libproc.h>
#endif
usingnamespacellvm;
static ManagedStatic<std::string> LibSupportInfoOutputFilename;
static std::string &getLibSupportInfoOutputFilename() { … }
static ManagedStatic<sys::SmartMutex<true> > TimerLock;
static ManagedStatic<SignpostEmitter> Signposts;
namespace {
struct CreateTrackSpace { … };
static ManagedStatic<cl::opt<bool>, CreateTrackSpace> TrackSpace;
struct CreateInfoOutputFilename { … };
static ManagedStatic<cl::opt<std::string, true>, CreateInfoOutputFilename>
InfoOutputFilename;
struct CreateSortTimers { … };
ManagedStatic<cl::opt<bool>, CreateSortTimers> SortTimers;
}
void llvm::initTimerOptions() { … }
std::unique_ptr<raw_fd_ostream> llvm::CreateInfoOutputFile() { … }
namespace {
struct CreateDefaultTimerGroup { … };
}
static ManagedStatic<TimerGroup, CreateDefaultTimerGroup> DefaultTimerGroup;
static TimerGroup *getDefaultTimerGroup() { … }
void Timer::init(StringRef TimerName, StringRef TimerDescription) { … }
void Timer::init(StringRef TimerName, StringRef TimerDescription,
TimerGroup &tg) { … }
Timer::~Timer() { … }
static inline size_t getMemUsage() { … }
static uint64_t getCurInstructionsExecuted() { … }
TimeRecord TimeRecord::getCurrentTime(bool Start) { … }
void Timer::startTimer() { … }
void Timer::stopTimer() { … }
void Timer::clear() { … }
static void printVal(double Val, double Total, raw_ostream &OS) { … }
void TimeRecord::print(const TimeRecord &Total, raw_ostream &OS) const { … }
namespace {
Name2TimerMap;
class Name2PairMap { … };
}
static ManagedStatic<Name2PairMap> NamedGroupedTimers;
NamedRegionTimer::NamedRegionTimer(StringRef Name, StringRef Description,
StringRef GroupName,
StringRef GroupDescription, bool Enabled)
: … { … }
static TimerGroup *TimerGroupList = …;
TimerGroup::TimerGroup(StringRef Name, StringRef Description)
: … { … }
TimerGroup::TimerGroup(StringRef Name, StringRef Description,
const StringMap<TimeRecord> &Records)
: … { … }
TimerGroup::~TimerGroup() { … }
void TimerGroup::removeTimer(Timer &T) { … }
void TimerGroup::addTimer(Timer &T) { … }
void TimerGroup::PrintQueuedTimers(raw_ostream &OS) { … }
void TimerGroup::prepareToPrintList(bool ResetTime) { … }
void TimerGroup::print(raw_ostream &OS, bool ResetAfterPrint) { … }
void TimerGroup::clear() { … }
void TimerGroup::printAll(raw_ostream &OS) { … }
void TimerGroup::clearAll() { … }
void TimerGroup::printJSONValue(raw_ostream &OS, const PrintRecord &R,
const char *suffix, double Value) { … }
const char *TimerGroup::printJSONValues(raw_ostream &OS, const char *delim) { … }
const char *TimerGroup::printAllJSONValues(raw_ostream &OS, const char *delim) { … }
void TimerGroup::constructForStatistics() { … }
std::unique_ptr<TimerGroup> TimerGroup::aquireDefaultGroup() { … }