top | up | prev | next

Profiler Class

Definition at line 37 of Profile.cpp

Member Functions

std::vector<FunctionProfileData>* CreateFunctionProfileData()
void Done() static
void EndFunction(const boost::uuids::uuid& functionId)
void Init() static
Profiler& Instance() static
void StartFunction(const boost::uuids::uuid& functionId)
void WriteData()

Member Variables

std::unique_ptr<Profiler> instance static
std::mutex mtx
std::vector<std::unique_ptr<std::vector<FunctionProfileData>>> profileData

Member Function Details

CreateFunctionProfileData Member Function

std::vector<FunctionProfileData >* cmajor::rt::Profiler::CreateFunctionProfileData()

Definition at line 65 of Profile.cpp :
 66 {
 67     std::lock_guard<std::mutex> lock(mtx);
 68     profileData.push_back(std::unique_ptr<std::std::vector<FunctionProfileData>>(new std::vector<FunctionProfileData>()));
 69     return profileData.back().get();
 70 }


Declaration at line 45 of Profile.cpp

Called by: cmajor::rt::Profiler::EndFunction , cmajor::rt::Profiler::StartFunction


Done Member Function

void cmajor::rt::Profiler::Done() static

Definition at line 60 of Profile.cpp :
 61 {
 62     instance.reset();
 63 }


Declaration at line 41 of Profile.cpp


EndFunction Member Function

void cmajor::rt::Profiler::EndFunction(const boost::uuids::uuid& functionId)

Definition at line 109 of Profile.cpp :
110 {
111     if (!functionProfileData)
112     {
113         functionProfileData = CreateFunctionProfileData();
114     }
115     functionProfileData->push_back(FunctionProfileData(TimePointKind::endfunctionId));
116 }


Declaration at line 44 of Profile.cpp

Calls: cmajor::rt::Profiler::CreateFunctionProfileData


Init Member Function

void cmajor::rt::Profiler::Init() static

Definition at line 55 of Profile.cpp :
 56 {
 57     instance.reset(new Profiler());
 58 }


Declaration at line 40 of Profile.cpp


Instance Member Function

Profiler & cmajor::rt::Profiler::Instance() static

Definition at line 42 of Profile.cpp :
 42 { return *instance; }


StartFunction Member Function

void cmajor::rt::Profiler::StartFunction(const boost::uuids::uuid& functionId)

Definition at line 100 of Profile.cpp :
101 {
102     if (!functionProfileData)
103     {
104         functionProfileData = CreateFunctionProfileData();
105     }
106     functionProfileData->push_back(FunctionProfileData(TimePointKind::startfunctionId));
107 }


Declaration at line 43 of Profile.cpp

Calls: cmajor::rt::Profiler::CreateFunctionProfileData


WriteData Member Function

void cmajor::rt::Profiler::WriteData()

Definition at line 72 of Profile.cpp
Declaration at line 46 of Profile.cpp

Calls: soulng::util::BinaryWriter::Write , soulng::util::BinaryWriter::Write , soulng::util::Path::Combine , soulng::util::Path::GetDirectoryName


top | up | prev | next