hyperion.ng/include/utils/Profiler.h
redPanther 36b4d072c5 common ledbuffer for color transform (#77)
* common ledbuffer for color transform

hyperion class uses a common buffer for all operations on ledColors got from muxer
all color transforms uses new ledBuffer instead of making copies of ledbuffer

other fixes:
fix compile bug in profiler
update doxygen config

* migrate logging for color transform classes

* prepare new logger in hyperion class

* implement hwledcount

* Update Hyperion.cpp

Fix off color

* remove ledscount equivalent from apa102
migrate logging in hyperion.cpp
remove unused and duuplicate colorcorrection - but same is available through tempertature

* remove colorcorrection completly
fix compile

* set colororder back to static

* in remote: using correction is the same as using temperature - correction is obsolete, command not delete atm for compat reasons
2016-07-01 23:20:41 +02:00

39 lines
1.3 KiB
C++

#include <string>
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
#include <map>
#include <utils/Logger.h>
#include <HyperionConfig.h>
#ifndef ENABLE_PROFILER
#error "Profiler is not for productive code, enable it via cmake or remove header include"
#endif
// profiler
#define PROFILER_BLOCK_EXECUTION_TIME Profiler DEBUG_PROFILE__BLOCK__EXECUTION__TIME_messure_object(__FILE__, _FUNCNAME_, __LINE__ );
#define PROFILER_TIMER_START(stopWatchName) Profiler::TimerStart(stopWatchName, __FILE__, _FUNCNAME_, __LINE__);
#define PROFILER_TIMER_GET(stopWatchName) Profiler::TimerGetTime(stopWatchName, __FILE__, _FUNCNAME_, __LINE__);
#define PROFILER_TIMER_GET_IF(condition, stopWatchName) { if (condition) {Profiler::TimerGetTime(stopWatchName, __FILE__, _FUNCNAME_, __LINE__);} }
class Profiler
{
public:
Profiler(const char* sourceFile, const char* func, unsigned int line);
~Profiler();
static void TimerStart(const std::string stopWatchName, const char* sourceFile, const char* func, unsigned int line);
static void TimerGetTime(const std::string stopWatchName, const char* sourceFile, const char* func, unsigned int line);
private:
static void initLogger();
static Logger* _logger;
const char* _file;
const char* _func;
unsigned int _line;
unsigned int _blockId;
clock_t _startTime;
};