2019-10-18 20:54:45 +00:00
|
|
|
/*
|
2019-10-20 01:17:44 +00:00
|
|
|
* 4coder_profile.cpp - Built in self profiling report.
|
2019-10-18 20:54:45 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
// TOP
|
|
|
|
|
|
|
|
#if !defined(FCODER_PROFILE_H)
|
|
|
|
#define FCODER_PROFILE_H
|
|
|
|
|
2019-10-26 20:48:50 +00:00
|
|
|
struct Profile_Global_List{
|
|
|
|
System_Mutex mutex;
|
|
|
|
Arena node_arena;
|
|
|
|
Arena_Node *first_arena;
|
|
|
|
Arena_Node *last_arena;
|
|
|
|
Profile_Thread *first_thread;
|
|
|
|
Profile_Thread *last_thread;
|
|
|
|
i32 thread_count;
|
|
|
|
Profile_Enable_Flag disable_bits;
|
|
|
|
};
|
|
|
|
|
2019-10-20 01:17:44 +00:00
|
|
|
struct Profile_Block{
|
|
|
|
Thread_Context *tctx;
|
2019-10-26 20:48:50 +00:00
|
|
|
Profile_Global_List *list;
|
2019-10-20 01:17:44 +00:00
|
|
|
b32 is_closed;
|
|
|
|
Profile_ID id;
|
2019-10-18 20:54:45 +00:00
|
|
|
|
2019-10-26 20:48:50 +00:00
|
|
|
Profile_Block(Thread_Context *tctx, Profile_Global_List *list,
|
|
|
|
String_Const_u8 name, String_Const_u8 location);
|
2019-10-20 01:17:44 +00:00
|
|
|
Profile_Block(Application_Links *app, String_Const_u8 name, String_Const_u8 location);
|
|
|
|
~Profile_Block();
|
|
|
|
void close_now();
|
2019-10-18 20:54:45 +00:00
|
|
|
};
|
|
|
|
|
2019-10-20 01:17:44 +00:00
|
|
|
struct Profile_Scope_Block{
|
|
|
|
Thread_Context *tctx;
|
2019-10-26 20:48:50 +00:00
|
|
|
Profile_Global_List *list;
|
2019-10-20 01:17:44 +00:00
|
|
|
b32 is_closed;
|
|
|
|
Profile_ID id;
|
|
|
|
|
2019-10-26 20:48:50 +00:00
|
|
|
Profile_Scope_Block(Thread_Context *tctx, Profile_Global_List *list,
|
|
|
|
String_Const_u8 name, String_Const_u8 location);
|
2019-10-20 01:17:44 +00:00
|
|
|
Profile_Scope_Block(Application_Links *app, String_Const_u8 name, String_Const_u8 location);
|
|
|
|
~Profile_Scope_Block();
|
|
|
|
void close_now();
|
2019-10-18 20:54:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// BOTTOM
|
|
|
|
|