adjust pre-emptive conversion heuristics; fix deadlock scenario in match work

This commit is contained in:
Ryan Fleury
2024-11-14 09:10:07 -08:00
parent 4c0ebc851c
commit fa4f9621b0
2 changed files with 9 additions and 10 deletions
+6 -9
View File
@@ -4136,7 +4136,7 @@ ctrl_thread__next_dmn_event(Arena *arena, DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg,
//- rjf: for each module, use its full path as the start to a new limited recursive
// directory search. cache each directory once traversed in the dbg_dir tree. if any
// node is not cached, then scan it & pre-emptively convert debug info.
ProfScope("pre-emptively load adjacent debug info")
ProfScope("pre-emptively load adjacent debug info for %.*s", str8_varg(loaded_module->string))
{
//- rjf: calculate seed path
DI_Key loaded_di_key = ctrl_dbgi_key_from_module(loaded_module);
@@ -4177,18 +4177,15 @@ ctrl_thread__next_dmn_event(Arena *arena, DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg,
parent_dir_node = next_child;
}
//- rjf: iterate from dir node up its ancestor chain - do recursive searches if:
//
// (a) this is the direct ancestor of a loaded module, and it has not
// been searched yet (search_count == 0)
// (b) this is an indirect ancestor of loaded modules, it has not been
// searched yet, but it has >4 child branches, meaning it looks like
// a project directory
//- rjf: iterate from dir node up its ancestor chain - do recursive
// searches if this is an ancestor of loaded modules, it has not been
// searched yet, but it has >4 child branches, meaning it looks like
// project directory
//
DI_KeyList preemptively_loaded_keys = {0};
for(CTRL_DbgDirNode *dir_node = parent_dir_node; dir_node != 0; dir_node = dir_node->parent)
{
if(dir_node->search_count == 0 && (dir_node == parent_dir_node || dir_node->child_count >= 4))
if(dir_node->search_count == 0 && dir_node->child_count >= 4)
{
//- rjf: form full path of this directory node
String8List dir_node_path_parts = {0};
+3 -1
View File
@@ -826,6 +826,7 @@ ASYNC_WORK_DEF(di_parse_work)
//
DI_Key key = {0};
di_u2p_dequeue_key(scratch.arena, &key);
ProfBegin("di_parse_work: %.*s", str8_varg(key.path));
String8 og_path = key.path;
U64 min_timestamp = key.min_timestamp;
@@ -1117,6 +1118,7 @@ ASYNC_WORK_DEF(di_parse_work)
scratch_end(scratch);
ProfEnd();
ProfEnd();
return 0;
}
@@ -1723,7 +1725,7 @@ ASYNC_WORK_DEF(di_match_work)
{
DI_Scope *di_scope = di_scope_open();
DI_Key key = params_keys.v[dbgi_idx];
RDI_Parsed *rdi = di_rdi_from_key(di_scope, &key, max_U64);
RDI_Parsed *rdi = di_rdi_from_key(di_scope, &key, os_now_microseconds()+1000);
for EachElement(name_map_kind_idx, name_map_kinds)
{
RDI_NameMap *name_map = rdi_element_from_name_idx(rdi, NameMaps, name_map_kinds[name_map_kind_idx]);