Commit 29b1c388 authored by Michal Majewski's avatar Michal Majewski Committed by Commit Bot

[test] Introduce stress sampling allocation profiler mode

Bug: v8:7209
Change-Id: Ia10479d7eea6ef2f352d008e2f4b74e2394ab79b
Cq-Include-Trybots: luci.v8.try:v8_linux64_fyi_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/861623
Commit-Queue: Michał Majewski <majeski@google.com>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Reviewed-by: 's avatarAli Ijaz Sheikh <ofrobots@google.com>
Cr-Commit-Position: refs/heads/master@{#50527}
parent 42e8ca99
......@@ -29,8 +29,12 @@
],
'V8 Linux64 - fyi': [
{'name': 'v8testing', 'variant': 'infra_staging', 'shards': 1},
{'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1},
{'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1},
],
'V8 Linux64 - debug - fyi': [
{'name': 'v8testing', 'variant': 'infra_staging', 'shards': 2},
{'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1},
{'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1},
],
}
......@@ -10,6 +10,8 @@
'v8_linux64_fyi_rel_ng_triggered': [
{'name': 'v8testing', 'variant': 'infra_staging', 'shards': 2},
{'name': 'mjsunit', 'variant': 'stress_sampling', 'shards': 1},
{'name': 'webkit', 'variant': 'stress_sampling', 'shards': 1},
],
'v8_linux64_rel_ng_triggered': [
{'name': 'v8testing', 'variant': 'minor_mc', 'shards': 1},
......
......@@ -588,6 +588,9 @@ DEFINE_INT(frame_count, 1, "number of stack frames inspected by the profiler")
DEFINE_INT(type_info_threshold, 25,
"percentage of ICs that must have type info to allow optimization")
DEFINE_INT(stress_sampling_allocation_profiler, 0,
"Enables sampling allocation profiler with X as a sample interval")
// Garbage collections flags.
DEFINE_INT(min_semi_space_size, 0,
"min size of a semi-space (in MBytes), the new space consists of two"
......
......@@ -2568,6 +2568,10 @@ Isolate::Isolate(bool enable_serializer)
void Isolate::TearDown() {
TRACE_ISOLATE(tear_down);
if (FLAG_stress_sampling_allocation_profiler > 0) {
heap_profiler()->StopSamplingHeapProfiler();
}
// Temporarily set this isolate as current so that various parts of
// the isolate can access it in their destructors without having a
// direct pointer. We don't use Enter/Exit here to avoid
......@@ -3034,6 +3038,15 @@ bool Isolate::Init(StartupDeserializer* des) {
if (!FLAG_inline_new) heap_.DisableInlineAllocation();
if (FLAG_stress_sampling_allocation_profiler > 0) {
uint64_t sample_interval = FLAG_stress_sampling_allocation_profiler;
int stack_depth = 128;
v8::HeapProfiler::SamplingFlags sampling_flags =
v8::HeapProfiler::SamplingFlags::kSamplingForceGC;
heap_profiler()->StartSamplingHeapProfiler(sample_interval, stack_depth,
sampling_flags);
}
return true;
}
......
......@@ -16,6 +16,8 @@ ALL_VARIANT_FLAGS = {
# https://chromium-review.googlesource.com/c/452620/ for more discussion.
"nooptimization": [["--noopt"]],
"stress_background_compile": [["--background-compile", "--stress-background-compile"]],
# Trigger stress sampling allocation profiler with sample interval = 2^14
"stress_sampling": [["--stress-sampling-allocation-profiler=16384"]],
"trusted": [["--no-untrusted-code-mitigations"]],
"wasm_traps": [["--wasm_trap_handler", "--invoke-weak-callbacks", "--wasm-jit-to-native"]],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment