
#ifndef PLS_PROFILER_H
#define PLS_PROFILER_H
#ifdef ENABLE_EASY_PROFILER

#include <easy/profiler.h>
#include <easy/arbitrary_value.h>

#define PROFILE_TASK(msg) EASY_BLOCK(msg, profiler::colors::LightBlue)
#define PROFILE_CONTINUATION(msg) EASY_BLOCK(msg, profiler::colors::LightBlue)
#define PROFILE_FAST_PATH(msg) EASY_BLOCK(msg, profiler::colors::Green)
#define PROFILE_STEALING(msg) EASY_BLOCK(msg, profiler::colors::Orange)
#define PROFILE_LOCK(msg) EASY_BLOCK(msg, profiler::colors::Red)

#define PROFILE_END_BLOCK EASY_END_BLOCK

#define PROFILE_SAVE(filename) profiler::dumpBlocksToFile(filename);
#define PROFILE_ENABLE EASY_PROFILER_ENABLE
#define PROFILE_MAIN_THREAD EASY_MAIN_THREAD

#define PROFILE_VALUE(name, value) EASY_VALUE(name, value)

#else //ENABLE_EASY_PROFILER

#define PROFILE_TASK(msg)
#define PROFILE_CONTINUATION(msg)
#define PROFILE_FAST_PATH(msg)
#define PROFILE_STEALING(msg)
#define PROFILE_LOCK(msg)

#define PROFILE_END_BLOCK

#define PROFILE_SAVE(filename)
#define PROFILE_ENABLE
#define PROFILE_MAIN_THREAD

#define PROFILE_VALUE(name, value)

#endif //ENABLE_EASY_PROFILER
#endif //PLS_PROFILER_H
