From d6432428855877357e2dd98b923b6d7ad23b217a Mon Sep 17 00:00:00 2001 From: Sergey Yagovtsev Date: Thu, 18 Feb 2016 00:45:13 +0300 Subject: [PATCH] Added function beginBlock --- include/profiler/profiler.h | 5 +++-- src/profile_manager.cpp | 10 ++++++++++ src/profile_manager.h | 1 + 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/profiler/profiler.h b/include/profiler/profiler.h index 196e046..cfffbb7 100644 --- a/include/profiler/profiler.h +++ b/include/profiler/profiler.h @@ -33,10 +33,10 @@ along with this program.If not, see . profiler::registerMark(&TOKEN_CONCATENATE(unique_profiler_mark_name_,__LINE__)); #define PROFILER_BEGIN_BLOCK(name) profiler::Block TOKEN_CONCATENATE(unique_profiler_mark_name_,__LINE__)(name);\ - profiler::registerMark(&TOKEN_CONCATENATE(unique_profiler_mark_name_,__LINE__)); + profiler::beginBlock(&TOKEN_CONCATENATE(unique_profiler_mark_name_,__LINE__)); #define PROFILER_BEGIN_BLOCK_GROUPED(name,block_group) profiler::Block TOKEN_CONCATENATE(unique_profiler_mark_name_,__LINE__)(name,block_group);\ - profiler::registerMark(&TOKEN_CONCATENATE(unique_profiler_mark_name_,__LINE__)); + profiler::beginBlock(&TOKEN_CONCATENATE(unique_profiler_mark_name_,__LINE__)); #define PROFILER_BEGIN_FUNCTION_BLOCK PROFILER_BEGIN_BLOCK(__func__) @@ -68,6 +68,7 @@ namespace profiler extern "C"{ void PROFILER_API registerMark(Mark* _mark); + void PROFILER_API beginBlock(Block* _block); void PROFILER_API endBlock(); void PROFILER_API setEnabled(bool isEnable); diff --git a/src/profile_manager.cpp b/src/profile_manager.cpp index 1891bdc..5321e73 100644 --- a/src/profile_manager.cpp +++ b/src/profile_manager.cpp @@ -21,6 +21,11 @@ extern "C"{ { ProfileManager::instance()->setEnabled(isEnable); } + + void PROFILER_API beginBlock(Block* _block) + { + ProfileManager::instance()->beginBlock(_block); + } } @@ -45,6 +50,11 @@ void ProfileManager::registerMark(profiler::Mark* _mark) } +void ProfileManager::beginBlock(profiler::Block* _block) +{ + +} + void ProfileManager::endBlock() { diff --git a/src/profile_manager.h b/src/profile_manager.h index 43fee2b..81da5af 100644 --- a/src/profile_manager.h +++ b/src/profile_manager.h @@ -33,6 +33,7 @@ public: static ProfileManager* instance(); void registerMark(profiler::Mark* _mark); + void beginBlock(profiler::Block* _block); void endBlock(); void setEnabled(bool isEnable); };