add some checks to the profiler
parent
79ad108fab
commit
8535480ad5
|
@ -1,6 +1,6 @@
|
||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
include(cmake/color.cmake)
|
include(cmake/color.cmake)
|
||||||
set(BLT_VERSION 0.18.20)
|
set(BLT_VERSION 0.18.21)
|
||||||
set(BLT_TEST_VERSION 0.0.1)
|
set(BLT_TEST_VERSION 0.0.1)
|
||||||
|
|
||||||
set(BLT_TARGET BLT)
|
set(BLT_TARGET BLT)
|
||||||
|
|
|
@ -227,11 +227,15 @@ namespace blt
|
||||||
|
|
||||||
void _internal::endInterval(const std::string& profile_name, const std::string& interval_name)
|
void _internal::endInterval(const std::string& profile_name, const std::string& interval_name)
|
||||||
{
|
{
|
||||||
|
if (profiles[profile_name].empty() || profiles[profile_name].find(interval_name) == profiles[profile_name].end())
|
||||||
|
return;
|
||||||
blt::endInterval(profiles[profile_name].at(interval_name));
|
blt::endInterval(profiles[profile_name].at(interval_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
void _internal::writeProfile(std::ifstream& stream, const std::string& profile_name)
|
void _internal::writeProfile(std::ifstream& stream, const std::string& profile_name)
|
||||||
{
|
{
|
||||||
|
if (profiles.find(profile_name) == profiles.end())
|
||||||
|
return;
|
||||||
auto& pref = profiles[profile_name];
|
auto& pref = profiles[profile_name];
|
||||||
profile_t profile{profile_name};
|
profile_t profile{profile_name};
|
||||||
for (const auto& i : pref)
|
for (const auto& i : pref)
|
||||||
|
@ -242,6 +246,8 @@ namespace blt
|
||||||
|
|
||||||
void _internal::printProfile(const std::string& profile_name, std::uint32_t flags, sort_by sort, blt::logging::log_level log_level)
|
void _internal::printProfile(const std::string& profile_name, std::uint32_t flags, sort_by sort, blt::logging::log_level log_level)
|
||||||
{
|
{
|
||||||
|
if (profiles.find(profile_name) == profiles.end())
|
||||||
|
return;
|
||||||
auto& pref = profiles[profile_name];
|
auto& pref = profiles[profile_name];
|
||||||
profile_t profile{profile_name};
|
profile_t profile{profile_name};
|
||||||
for (const auto& i : pref)
|
for (const auto& i : pref)
|
||||||
|
|
Loading…
Reference in New Issue