Update the profiler to allow for different level of profiling
This commit is contained in:
@@ -7,17 +7,29 @@
|
||||
#define MAX_PROFILE_SAMPLES 1024
|
||||
#endif // !MAX_PROFILE_SAMPLES
|
||||
|
||||
#ifdef ENABLE_PROFILING
|
||||
#define PROFILE_START(COUNT) profile_start(COUNT)
|
||||
#define PROFILE_END profile_end()
|
||||
#ifdef FULL_PROFILING
|
||||
#define SAMPLE_START(ID, TITLE) sample_start(ID, TITLE)
|
||||
#define SAMPLE_END(ID) sample_end(ID)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void sample_start(u64 id, const char *title);
|
||||
void sample_end(u64 id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define PROFILE_START(COUNT)
|
||||
#define PROFILE_END
|
||||
#define SAMPLE_START(ID, TITLE)
|
||||
#define SAMPLE_END(ID)
|
||||
#endif // ENABLE_PROFILING
|
||||
#endif // FULL_PROFILING
|
||||
|
||||
#if defined(BASIC_PROFILING) || defined(FULL_PROFILING)
|
||||
#define PROFILE_START(COUNT) profile_start(COUNT)
|
||||
#define PROFILE_END profile_end()
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -49,11 +61,13 @@ u64 get_cpu_freq(u64 milliseconds);
|
||||
void profile_start(u64 count);
|
||||
void profile_end();
|
||||
|
||||
void sample_start(u64 id, const char *title);
|
||||
void sample_end(u64 id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define PROFILE_START(COUNT)
|
||||
#define PROFILE_END
|
||||
#endif // BASIC_PROFILING || FULL_PROFILING
|
||||
|
||||
#endif // !TIMER_H
|
||||
|
||||
Reference in New Issue
Block a user