lugre_profile.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef LUGRE_PROFILE_H
00025 #define LUGRE_PROFILE_H
00026
00027 namespace Lugre {
00028 #define ENABLE_PROFILING
00029
00030 #ifdef ENABLE_PROFILING
00031
00032
00033 class cProfiler { public:
00034 cProfiler(const char* sFile,const int iLine,const char* sFunc);
00035 ~cProfiler();
00036
00037 static void PrintStackTrace ();
00038 static void PrintStackTrace (const char *filename);
00039 };
00040
00042 #define PROFILE cProfiler local_profiler(__FILE__,__LINE__,__FUNCTION__);
00043 #define PROFILEH PROFILE // enable profiling of heavy duty functions
00044 #define PROFILE_PRINT_STACKTRACE cProfiler::PrintStackTrace();
00045 #define PROFILE_PRINT_STACKTRACE_TOFILE(filename) cProfiler::PrintStackTrace(filename);
00046 #else
00047 #define PROFILE
00048 #define PROFILEH PROFILE
00049 #define PROFILE_HEAVY PROFILE
00050 #define PROFILE_PRINT_STACKTRACE
00051 #define PROFILE_PRINT_STACKTRACE_TOFILE(filename)
00052 #endif
00053
00055 #ifndef PROFILEH
00056 #define PROFILEH
00057 #endif
00058 };
00059
00060 #endif