mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 22:08:41 +00:00
dbg info conversion events
This commit is contained in:
@@ -96,6 +96,8 @@ di_init(CmdLine *cmdline)
|
|||||||
di_shared->conversion_completion_shared_memory_base = (U64 *)os_shared_memory_view_open(di_shared->conversion_completion_shared_memory, r1u64(0, KB(4)));
|
di_shared->conversion_completion_shared_memory_base = (U64 *)os_shared_memory_view_open(di_shared->conversion_completion_shared_memory, r1u64(0, KB(4)));
|
||||||
di_shared->completion_mutex = mutex_alloc();
|
di_shared->completion_mutex = mutex_alloc();
|
||||||
di_shared->completion_arena = arena_alloc();
|
di_shared->completion_arena = arena_alloc();
|
||||||
|
di_shared->event_mutex = mutex_alloc();
|
||||||
|
di_shared->event_arena = arena_alloc();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
@@ -486,6 +488,29 @@ di_rdi_from_key(Access *access, DI_Key key, B32 high_priority, U64 endt_us)
|
|||||||
return rdi;
|
return rdi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: Events
|
||||||
|
|
||||||
|
internal DI_EventList
|
||||||
|
di_get_events(Arena *arena)
|
||||||
|
{
|
||||||
|
DI_EventList dst = {0};
|
||||||
|
MutexScope(di_shared->event_mutex)
|
||||||
|
{
|
||||||
|
for EachNode(src_n, DI_EventNode, di_shared->events.first)
|
||||||
|
{
|
||||||
|
DI_EventNode *dst_n = push_array(arena, DI_EventNode, 1);
|
||||||
|
MemoryCopyStruct(&dst_n->v, &src_n->v);
|
||||||
|
dst_n->v.string = str8_copy(arena, dst_n->v.string);
|
||||||
|
SLLQueuePush(dst.first, dst.last, dst_n);
|
||||||
|
dst.count += 1;
|
||||||
|
}
|
||||||
|
MemoryZeroStruct(&di_shared->events);
|
||||||
|
arena_clear(di_shared->event_arena);
|
||||||
|
}
|
||||||
|
return dst;
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: Asynchronous Tick
|
//~ rjf: Asynchronous Tick
|
||||||
|
|
||||||
@@ -738,6 +763,16 @@ di_async_tick(void)
|
|||||||
t->status = DI_LoadTaskStatus_Active;
|
t->status = DI_LoadTaskStatus_Active;
|
||||||
di_shared->conversion_process_count += 1;
|
di_shared->conversion_process_count += 1;
|
||||||
di_shared->conversion_thread_count += t->thread_count;
|
di_shared->conversion_thread_count += t->thread_count;
|
||||||
|
|
||||||
|
// rjf: send event
|
||||||
|
MutexScope(di_shared->event_mutex)
|
||||||
|
{
|
||||||
|
DI_EventNode *n = push_array(di_shared->event_arena, DI_EventNode, 1);
|
||||||
|
SLLQueuePush(di_shared->events.first, di_shared->events.last, n);
|
||||||
|
di_shared->events.count += 1;
|
||||||
|
n->v.kind = DI_EventKind_ConversionStarted;
|
||||||
|
n->v.string = str8_copy(di_shared->event_arena, rdi_path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//- rjf: if active & process has completed, mark as done
|
//- rjf: if active & process has completed, mark as done
|
||||||
@@ -785,6 +820,14 @@ di_async_tick(void)
|
|||||||
//- rjf: if task is done, retire & recycle task; gather path to load
|
//- rjf: if task is done, retire & recycle task; gather path to load
|
||||||
if(t->status == DI_LoadTaskStatus_Done)
|
if(t->status == DI_LoadTaskStatus_Done)
|
||||||
{
|
{
|
||||||
|
if(!os_handle_match(t->process, os_handle_zero())) MutexScope(di_shared->event_mutex)
|
||||||
|
{
|
||||||
|
DI_EventNode *n = push_array(di_shared->event_arena, DI_EventNode, 1);
|
||||||
|
SLLQueuePush(di_shared->events.first, di_shared->events.last, n);
|
||||||
|
di_shared->events.count += 1;
|
||||||
|
n->v.kind = DI_EventKind_ConversionEnded;
|
||||||
|
n->v.string = str8_copy(di_shared->event_arena, rdi_path);
|
||||||
|
}
|
||||||
DLLRemove(di_shared->first_load_task, di_shared->last_load_task, t);
|
DLLRemove(di_shared->first_load_task, di_shared->last_load_task, t);
|
||||||
SLLStackPush(di_shared->free_load_task, t);
|
SLLStackPush(di_shared->free_load_task, t);
|
||||||
ParseTaskNode *n = push_array(scratch.arena, ParseTaskNode, 1);
|
ParseTaskNode *n = push_array(scratch.arena, ParseTaskNode, 1);
|
||||||
|
|||||||
@@ -204,6 +204,40 @@ struct DI_Match
|
|||||||
U32 idx;
|
U32 idx;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: Events
|
||||||
|
|
||||||
|
typedef enum DI_EventKind
|
||||||
|
{
|
||||||
|
DI_EventKind_Null,
|
||||||
|
DI_EventKind_ConversionStarted,
|
||||||
|
DI_EventKind_ConversionEnded,
|
||||||
|
DI_EventKind_COUNT
|
||||||
|
}
|
||||||
|
DI_EventKind;
|
||||||
|
|
||||||
|
typedef struct DI_Event DI_Event;
|
||||||
|
struct DI_Event
|
||||||
|
{
|
||||||
|
DI_EventKind kind;
|
||||||
|
String8 string;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct DI_EventNode DI_EventNode;
|
||||||
|
struct DI_EventNode
|
||||||
|
{
|
||||||
|
DI_EventNode *next;
|
||||||
|
DI_Event v;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct DI_EventList DI_EventList;
|
||||||
|
struct DI_EventList
|
||||||
|
{
|
||||||
|
DI_EventNode *first;
|
||||||
|
DI_EventNode *last;
|
||||||
|
U64 count;
|
||||||
|
};
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: Shared State
|
//~ rjf: Shared State
|
||||||
|
|
||||||
@@ -254,6 +288,11 @@ struct DI_Shared
|
|||||||
Arena *completion_arena;
|
Arena *completion_arena;
|
||||||
DI_LoadCompletion *first_completion;
|
DI_LoadCompletion *first_completion;
|
||||||
DI_LoadCompletion *last_completion;
|
DI_LoadCompletion *last_completion;
|
||||||
|
|
||||||
|
// rjf: events
|
||||||
|
Mutex event_mutex;
|
||||||
|
Arena *event_arena;
|
||||||
|
DI_EventList events;
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
@@ -292,6 +331,11 @@ internal U64 di_load_gen(void);
|
|||||||
internal DI_KeyArray di_push_all_loaded_keys(Arena *arena);
|
internal DI_KeyArray di_push_all_loaded_keys(Arena *arena);
|
||||||
internal RDI_Parsed *di_rdi_from_key(Access *access, DI_Key key, B32 high_priority, U64 endt_us);
|
internal RDI_Parsed *di_rdi_from_key(Access *access, DI_Key key, B32 high_priority, U64 endt_us);
|
||||||
|
|
||||||
|
////////////////////////////////
|
||||||
|
//~ rjf: Events
|
||||||
|
|
||||||
|
internal DI_EventList di_get_events(Arena *arena);
|
||||||
|
|
||||||
////////////////////////////////
|
////////////////////////////////
|
||||||
//~ rjf: Asynchronous Tick
|
//~ rjf: Asynchronous Tick
|
||||||
|
|
||||||
|
|||||||
@@ -11399,10 +11399,9 @@ rd_frame(void)
|
|||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- rjf: sync with di parsers
|
//- rjf: sync with di parsers
|
||||||
//
|
//
|
||||||
#if 0 // TODO(rjf): @dbgi2
|
|
||||||
ProfScope("sync with di parsers")
|
ProfScope("sync with di parsers")
|
||||||
{
|
{
|
||||||
DI_EventList events = di_p2u_pop_events(scratch.arena, 0);
|
DI_EventList events = di_get_events(scratch.arena);
|
||||||
for(DI_EventNode *n = events.first; n != 0; n = n->next)
|
for(DI_EventNode *n = events.first; n != 0; n = n->next)
|
||||||
{
|
{
|
||||||
DI_Event *event = &n->v;
|
DI_Event *event = &n->v;
|
||||||
@@ -11430,7 +11429,6 @@ rd_frame(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- rjf: animate all views
|
//- rjf: animate all views
|
||||||
|
|||||||
Reference in New Issue
Block a user