2019-10-19 18:55:56 +00:00
|
|
|
/*
|
|
|
|
* 4coder_profile_inspect.h - Built in self profiling UI.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// TOP
|
|
|
|
|
|
|
|
#if !defined(FCODER_PROFILE_INSPECT_H)
|
|
|
|
#define FCODER_PROFILE_INSPECT_H
|
|
|
|
|
2019-10-20 01:17:44 +00:00
|
|
|
struct Profile_Slot{
|
|
|
|
Profile_Slot *next;
|
|
|
|
String_Const_u8 location;
|
2019-10-19 18:55:56 +00:00
|
|
|
String_Const_u8 name;
|
|
|
|
|
2019-10-20 01:17:44 +00:00
|
|
|
b32 corrupted_time;
|
2019-10-19 18:55:56 +00:00
|
|
|
u64 total_time;
|
2019-10-20 01:17:44 +00:00
|
|
|
i32 hit_count;
|
2019-10-19 18:55:56 +00:00
|
|
|
};
|
|
|
|
|
2019-10-20 01:17:44 +00:00
|
|
|
struct Profile_Node{
|
|
|
|
Profile_Node *next;
|
|
|
|
Profile_Slot *slot;
|
|
|
|
Range_u64 time;
|
|
|
|
Profile_ID id;
|
2019-10-19 18:55:56 +00:00
|
|
|
|
2019-10-20 01:17:44 +00:00
|
|
|
Profile_Node *first_child;
|
|
|
|
Profile_Node *last_child;
|
|
|
|
i32 child_count;
|
2019-10-19 18:55:56 +00:00
|
|
|
|
2019-10-20 01:17:44 +00:00
|
|
|
b32 closed;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Profile_Inspection_Thread{
|
|
|
|
i32 thread_id;
|
|
|
|
Profile_Node root;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Profile_Error{
|
|
|
|
Profile_Error *next;
|
|
|
|
String_Const_u8 message;
|
|
|
|
String_Const_u8 location;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef i32 Profile_Inspection_Tab;
|
|
|
|
enum{
|
|
|
|
ProfileInspectTab_None,
|
|
|
|
ProfileInspectTab_Threads,
|
|
|
|
ProfileInspectTab_Slots,
|
|
|
|
ProfileInspectTab_Errors
|
2019-10-19 18:55:56 +00:00
|
|
|
};
|
|
|
|
|
2019-10-19 19:16:31 +00:00
|
|
|
struct Profile_Inspection{
|
2019-10-20 01:17:44 +00:00
|
|
|
Profile_Slot *first_slot;
|
|
|
|
Profile_Slot *last_slot;
|
|
|
|
Profile_Error *first_error;
|
|
|
|
Profile_Error *last_error;
|
|
|
|
Profile_Inspection_Thread *threads;
|
|
|
|
i32 slot_count;
|
2019-10-19 19:16:31 +00:00
|
|
|
i32 thread_count;
|
2019-10-20 01:17:44 +00:00
|
|
|
i32 error_count;
|
|
|
|
|
|
|
|
Profile_Inspection_Tab tab_id;
|
|
|
|
Profile_Inspection_Tab tab_id_hovered;
|
|
|
|
|
2019-10-22 07:15:49 +00:00
|
|
|
String_Const_u8 full_name_hovered;
|
2019-10-20 01:17:44 +00:00
|
|
|
String_Const_u8 location_jump_hovered;
|
2019-10-19 19:16:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
global Profile_Inspection global_profile_inspection = {};
|
|
|
|
|
2019-10-19 18:55:56 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// TOP
|
|
|
|
|