diff --git a/GL/profiler.c b/GL/profiler.c index 968bc9f..c74d84a 100644 --- a/GL/profiler.c +++ b/GL/profiler.c @@ -6,6 +6,8 @@ #include "profiler.h" #include "../containers/aligned_vector.h" +#if PROFILING_COMPILED + #define MAX_PATH 256 typedef struct { @@ -141,3 +143,4 @@ void profiler_print_stats() { fprintf(stderr, "%-60s%-20f%-20f%" PRIu64 "\n", result->name, (double)avg, (double)ms, result->total_calls); } } +#endif diff --git a/GL/profiler.h b/GL/profiler.h index acaf8bf..acf07ed 100644 --- a/GL/profiler.h +++ b/GL/profiler.h @@ -7,12 +7,26 @@ typedef struct { uint64_t start_time_in_us; } Profiler; +#define PROFILING_COMPILED 0 +#if PROFILING_COMPILED Profiler* profiler_push(const char* name); -void profiler_checkpoint(const char* name); -void profiler_pop(); +void _profiler_checkpoint(const char* name); +void _profiler_pop(); -void profiler_print_stats(); +void _profiler_print_stats(); -void profiler_enable(); -void profiler_disable(); +void _profiler_enable(); +void _profiler_disable(); + +#else +#define profiler_push(name); +#define profiler_checkpoint(name); +#define profiler_pop(); + +#define profiler_print_stats(); + +#define profiler_enable(); +#define profiler_disable(); + +#endif