Skip to content

Commit

Permalink
lets try dynamic suppressions instead
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyMusatkin committed Jan 5, 2024
1 parent 4392292 commit 9efdd24
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 4 additions & 0 deletions builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@
["dir", "/s", "/b"]
]
}
},

"build_env": {
"ASAN_OPTIONS": "suppressions={source_dir}/tests/resources/suppressions_asan.txt"
}
}
14 changes: 4 additions & 10 deletions source/posix/system_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,23 +56,17 @@ uint16_t aws_get_cpu_group_count(void) {
return 1U;
}

AWS_SUPPRESS_ASAN static size_t s_numa_cpu_count_for_group(uint16_t group_idx) {
AWS_FATAL_ASSERT(g_numa_node_of_cpu_ptr);

size_t total_cpus = aws_system_info_processor_count();
size_t aws_get_cpu_count_for_group(uint16_t group_idx) {
if (g_numa_node_of_cpu_ptr) {
size_t total_cpus = aws_system_info_processor_count();

uint16_t cpu_count = 0;
for (size_t i = 0; i < total_cpus; ++i) {
if (group_idx == g_numa_node_of_cpu_ptr((int)i)) {
cpu_count++;
}
}
return cpu_count;
}

size_t aws_get_cpu_count_for_group(uint16_t group_idx) {
if (g_numa_node_of_cpu_ptr) {
return s_numa_cpu_count_for_group(group_idx);
return cpu_count;
}

return aws_system_info_processor_count();
Expand Down
1 change: 1 addition & 0 deletions tests/resources/suppressions_asan.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
interceptor_via_lib:libnuma.so

0 comments on commit 9efdd24

Please sign in to comment.