checkpoint on more artifact cache port of ctrl process memory streaming

This commit is contained in:
Ryan Fleury
2025-09-23 17:05:45 -07:00
parent 141b6c1396
commit 7e05a60ffe
3 changed files with 149 additions and 120 deletions
+1
View File
@@ -123,6 +123,7 @@ ac_artifact_from_key(Access *access, String8 key, U64 gen, AC_CreateFunctionType
n->v.create = create; n->v.create = create;
} }
cond_var_broadcast(async_tick_start_cond_var); cond_var_broadcast(async_tick_start_cond_var);
ins_atomic_u32_eval_assign(&async_loop_again, 1);
} }
// rjf: found node -> break // rjf: found node -> break
+29 -2
View File
@@ -7465,6 +7465,9 @@ ASYNC_WORK_DEF(ctrl_call_stack_tree_build_work)
internal AC_Artifact internal AC_Artifact
ctrl_memory_artifact_create(String8 key, B32 *retry_out) ctrl_memory_artifact_create(String8 key, B32 *retry_out)
{
AC_Artifact artifact = {0};
if(lane_idx() == 0)
{ {
//- rjf: unpack key //- rjf: unpack key
CTRL_Handle process = {0}; CTRL_Handle process = {0};
@@ -7583,10 +7586,14 @@ ctrl_memory_artifact_create(String8 key, B32 *retry_out)
} }
} }
//- rjf: return content key bundled as artifact //- rjf: bundle content key as artifact
AC_Artifact artifact = {0};
StaticAssert(sizeof(content_key) == sizeof(artifact), artifact_key_size_check); StaticAssert(sizeof(content_key) == sizeof(artifact), artifact_key_size_check);
MemoryCopyStruct(&artifact, &content_key); MemoryCopyStruct(&artifact, &content_key);
}
lane_sync_u64(&artifact.u64[0], 0);
lane_sync_u64(&artifact.u64[1], 0);
lane_sync_u64(&artifact.u64[2], 0);
lane_sync_u64(&artifact.u64[3], 0);
return artifact; return artifact;
} }
@@ -7597,3 +7604,23 @@ ctrl_memory_artifact_destroy(AC_Artifact artifact)
MemoryCopyStruct(&key, &artifact); MemoryCopyStruct(&key, &artifact);
c_close_key(key); c_close_key(key);
} }
internal C_Key
ctrl_key_from_process_vaddr_range_new(CTRL_Handle process, Rng1U64 vaddr_range, B32 zero_terminated, U64 endt_us, B32 *out_is_stale)
{
ProfBeginFunction();
struct
{
CTRL_Handle process;
Rng1U64 vaddr_range;
B32 zero_terminated;
} key_data = {process, vaddr_range, zero_terminated};
String8 key = str8_struct(&key_data);
Access *access = access_open();
AC_Artifact artifact = ac_artifact_from_key(access, key, ctrl_mem_gen(), ctrl_memory_artifact_create, ctrl_memory_artifact_destroy, 2048);
C_Key content_key = {0};
MemoryCopyStruct(&content_key, &artifact);
access_close(access);
ProfEnd();
return content_key;
}
+1
View File
@@ -1255,5 +1255,6 @@ ASYNC_WORK_DEF(ctrl_call_stack_tree_build_work);
internal AC_Artifact ctrl_memory_artifact_create(String8 key, B32 *retry_out); internal AC_Artifact ctrl_memory_artifact_create(String8 key, B32 *retry_out);
internal void ctrl_memory_artifact_destroy(AC_Artifact artifact); internal void ctrl_memory_artifact_destroy(AC_Artifact artifact);
internal C_Key ctrl_key_from_process_vaddr_range_new(CTRL_Handle process, Rng1U64 vaddr_range, B32 zero_terminated, U64 endt_us, B32 *out_is_stale);
#endif // CTRL_CORE_H #endif // CTRL_CORE_H