
#ifndef PLS_PROFILER_H
#define PLS_PROFILER_H
#ifdef ENABLE_EASY_PROFILER

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

#define PROFILE_WORK_BLOCK(msg) EASY_BLOCK(msg, profiler::colors::LightGreen)
#define PROFILE_FORK_JOIN_STEALING(msg) EASY_BLOCK(msg, profiler::colors::LightBlue)
#define PROFILE_STEALING(msg) EASY_BLOCK(msg, profiler::colors::Blue)
#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_WORK_BLOCK(msg)
#define PROFILE_FORK_JOIN_STEALING(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
