mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-28 17:28:14 +08:00
Linux build
This commit is contained in:
parent
18055c7616
commit
542783573d
@ -79,8 +79,8 @@ Block will be automatically completed by destructor.
|
|||||||
\ingroup profiler
|
\ingroup profiler
|
||||||
*/
|
*/
|
||||||
# define EASY_BLOCK(name, ...)\
|
# define EASY_BLOCK(name, ...)\
|
||||||
static const ::profiler::BlockDescRef EASY_UNIQUE_DESC(__LINE__) = ::profiler::registerDescription(::profiler::extract_enable_flag(__VA_ARGS__),\
|
static const ::profiler::BlockDescRef EASY_UNIQUE_DESC(__LINE__)(::profiler::registerDescription(::profiler::extract_enable_flag(__VA_ARGS__),\
|
||||||
EASY_COMPILETIME_NAME(name), __FILE__, __LINE__, ::profiler::BLOCK_TYPE_BLOCK, ::profiler::extract_color(__VA_ARGS__));\
|
EASY_COMPILETIME_NAME(name), __FILE__, __LINE__, ::profiler::BLOCK_TYPE_BLOCK, ::profiler::extract_color(__VA_ARGS__)));\
|
||||||
::profiler::Block EASY_UNIQUE_BLOCK(__LINE__)(EASY_UNIQUE_DESC(__LINE__), EASY_RUNTIME_NAME(name));\
|
::profiler::Block EASY_UNIQUE_BLOCK(__LINE__)(EASY_UNIQUE_DESC(__LINE__), EASY_RUNTIME_NAME(name));\
|
||||||
::profiler::beginBlock(EASY_UNIQUE_BLOCK(__LINE__)); // this is to avoid compiler warning about unused variable
|
::profiler::beginBlock(EASY_UNIQUE_BLOCK(__LINE__)); // this is to avoid compiler warning about unused variable
|
||||||
|
|
||||||
@ -109,8 +109,8 @@ Name of the block automatically created with function name.
|
|||||||
\ingroup profiler
|
\ingroup profiler
|
||||||
*/
|
*/
|
||||||
# define EASY_FUNCTION(...)\
|
# define EASY_FUNCTION(...)\
|
||||||
static const ::profiler::BlockDescRef EASY_UNIQUE_DESC(__LINE__) = ::profiler::registerDescription(::profiler::extract_enable_flag(__VA_ARGS__),\
|
static const ::profiler::BlockDescRef EASY_UNIQUE_DESC(__LINE__)(::profiler::registerDescription(::profiler::extract_enable_flag(__VA_ARGS__),\
|
||||||
__func__, __FILE__, __LINE__, ::profiler::BLOCK_TYPE_BLOCK, ::profiler::extract_color(__VA_ARGS__));\
|
__func__, __FILE__, __LINE__, ::profiler::BLOCK_TYPE_BLOCK, ::profiler::extract_color(__VA_ARGS__)));\
|
||||||
::profiler::Block EASY_UNIQUE_BLOCK(__LINE__)(EASY_UNIQUE_DESC(__LINE__), "");\
|
::profiler::Block EASY_UNIQUE_BLOCK(__LINE__)(EASY_UNIQUE_DESC(__LINE__), "");\
|
||||||
::profiler::beginBlock(EASY_UNIQUE_BLOCK(__LINE__)); // this is to avoid compiler warning about unused variable
|
::profiler::beginBlock(EASY_UNIQUE_BLOCK(__LINE__)); // this is to avoid compiler warning about unused variable
|
||||||
|
|
||||||
@ -149,9 +149,9 @@ will end previously opened EASY_BLOCK or EASY_FUNCTION.
|
|||||||
\ingroup profiler
|
\ingroup profiler
|
||||||
*/
|
*/
|
||||||
# define EASY_EVENT(name, ...)\
|
# define EASY_EVENT(name, ...)\
|
||||||
static const ::profiler::BlockDescRef EASY_UNIQUE_DESC(__LINE__) = \
|
static const ::profiler::BlockDescRef EASY_UNIQUE_DESC(__LINE__)(\
|
||||||
::profiler::registerDescription(::profiler::extract_enable_flag(__VA_ARGS__), EASY_COMPILETIME_NAME(name), __FILE__, __LINE__,\
|
::profiler::registerDescription(::profiler::extract_enable_flag(__VA_ARGS__), EASY_COMPILETIME_NAME(name), __FILE__, __LINE__,\
|
||||||
::profiler::BLOCK_TYPE_EVENT, ::profiler::extract_color(__VA_ARGS__));\
|
::profiler::BLOCK_TYPE_EVENT, ::profiler::extract_color(__VA_ARGS__)));\
|
||||||
::profiler::storeBlock(EASY_UNIQUE_DESC(__LINE__), EASY_RUNTIME_NAME(name));
|
::profiler::storeBlock(EASY_UNIQUE_DESC(__LINE__), EASY_RUNTIME_NAME(name));
|
||||||
|
|
||||||
/** Macro enabling profiler
|
/** Macro enabling profiler
|
||||||
@ -346,7 +346,7 @@ namespace profiler {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
BlockDescRef(const BaseBlockDescriptor& _desc) : m_desc(_desc) { }
|
explicit BlockDescRef(const BaseBlockDescriptor& _desc) : m_desc(_desc) { }
|
||||||
inline operator const BaseBlockDescriptor& () const { return m_desc; }
|
inline operator const BaseBlockDescriptor& () const { return m_desc; }
|
||||||
~BlockDescRef();
|
~BlockDescRef();
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ namespace profiler {
|
|||||||
|
|
||||||
template <class ... TArgs>
|
template <class ... TArgs>
|
||||||
inline color_t extract_color(TArgs...) {
|
inline color_t extract_color(TArgs...) {
|
||||||
static_assert(false, "No profiler::color_t in arguments list for EASY_BLOCK(name, ...)!");
|
static_assert(sizeof...(TArgs) < 2, "No profiler::color_t in arguments list for EASY_BLOCK(name, ...)!");
|
||||||
return ::profiler::colors::Default;
|
return ::profiler::colors::Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user