Skip to content

alloc profiler: fix analyzegc error #43875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 20, 2022
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
5 changes: 3 additions & 2 deletions src/gc-alloc-profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jl_combined_results g_combined_results; // Will live forever.

// === stack stuff ===

jl_raw_backtrace_t get_raw_backtrace() {
jl_raw_backtrace_t get_raw_backtrace() JL_NOTSAFEPOINT {
// A single large buffer to record backtraces onto
static jl_bt_element_t static_bt_data[JL_MAX_BT_SIZE];

Expand Down Expand Up @@ -120,7 +120,8 @@ JL_DLLEXPORT void jl_free_alloc_profile() {

void _maybe_record_alloc_to_profile(jl_value_t *val, size_t size) JL_NOTSAFEPOINT {
auto& global_profile = g_alloc_profile;
auto& profile = global_profile.per_thread_profiles[jl_threadid()];
auto thread_id = jl_atomic_load_relaxed(&jl_current_task->tid);
auto& profile = global_profile.per_thread_profiles[thread_id];

auto sample_val = double(rand()) / double(RAND_MAX);
auto should_record = sample_val <= global_profile.sample_rate;
Expand Down