Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/gc-alloc-profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ void _maybe_record_alloc_to_profile(jl_value_t *val, size_t size, jl_datatype_t

auto& profile = global_profile.per_thread_profiles[thread_id];

auto sample_val = double(rand()) / double(RAND_MAX);
jl_ptls_t ptls = jl_current_task->ptls;
auto sample_val = double(cong(UINT64_MAX, &ptls->rngseed)) / double(UINT64_MAX);
auto should_record = sample_val <= global_profile.sample_rate;
if (!should_record) {
return;
Expand Down