heap: Deprecate counters for GC UMA histograms

The following histograms have been deprecated, as they are superseded
by V8.GC.Cycle.*.Young or not needed anymore (next to each, the
corresponding isolate counter):

- V8.GCScavenger (gc_scavenger)
- V8.GCScavengerBackground (gc_scavenger_background)
- V8.GCScavengeReason (scavenge_reason)
- V8.GCScavengerForeground (gc_scavenger_foreground)
- V8.GCBackgroundScavenger (background_scavenger)
- V8.GCMarkCompactor (gc_mark_compactor)

This CL removes the corresponding instrumentation in the code and the
isolate counters.

Bug: chromium:1154636
Bug: chromium:1299555
Change-Id: I62d28ff60ef47a058fe148c7855af8e2c1cc0aed
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3487548
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79308}
This commit is contained in:
Nikolaos Papaspyrou 2022-02-25 12:44:41 +01:00 committed by V8 LUCI CQ
parent 301372c393
commit d0af99470f
3 changed files with 1 additions and 43 deletions

View File

@ -201,9 +201,7 @@ GCTracer::RecordGCPhasesInfo::RecordGCPhasesInfo(Heap* heap,
const bool in_background = heap->isolate()->IsIsolateInBackground();
if (Heap::IsYoungGenerationCollector(collector)) {
mode = Mode::Scavenger;
type_timer = counters->gc_scavenger();
type_priority_timer = in_background ? counters->gc_scavenger_background()
: counters->gc_scavenger_foreground();
type_timer = type_priority_timer = nullptr;
} else {
DCHECK_EQ(GarbageCollector::MARK_COMPACTOR, collector);
if (heap->incremental_marking()->IsStopped()) {
@ -531,8 +529,6 @@ void GCTracer::StopCycle(GarbageCollector collector) {
if (Heap::IsYoungGenerationCollector(collector)) {
ReportYoungCycleToRecorder();
counters->scavenge_reason()->AddSample(static_cast<int>(gc_reason));
// If a young generation GC interrupted an unfinished full GC cycle, restore
// the event corresponding to the full GC cycle.
if (young_gc_while_full_gc_) {
@ -1287,9 +1283,6 @@ void GCTracer::FetchBackgroundMarkCompactCounters() {
void GCTracer::FetchBackgroundMinorGCCounters() {
FetchBackgroundCounters(Scope::FIRST_MINOR_GC_BACKGROUND_SCOPE,
Scope::LAST_MINOR_GC_BACKGROUND_SCOPE);
heap_->isolate()->counters()->background_scavenger()->AddSample(
static_cast<int>(
current_.scopes[Scope::SCAVENGER_BACKGROUND_SCAVENGE_PARALLEL]));
}
void GCTracer::FetchBackgroundGeneralCounters() {
@ -1404,10 +1397,6 @@ void GCTracer::RecordGCSumCounters(double atomic_pause_duration) {
const double marking_background_duration =
background_counter_[Scope::MC_BACKGROUND_MARKING].total_duration_ms;
// UMA.
heap_->isolate()->counters()->gc_mark_compactor()->AddSample(
static_cast<int>(overall_duration));
// Emit trace event counters.
TRACE_EVENT_INSTANT2(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"V8.GCMarkCompactorSummary", TRACE_EVENT_SCOPE_THREAD,

View File

@ -13,7 +13,6 @@ namespace internal {
#define HISTOGRAM_RANGE_LIST(HR) \
/* Generic range histograms: HR(name, caption, min, max, num_buckets) */ \
HR(background_marking, V8.GCBackgroundMarking, 0, 10000, 101) \
HR(background_scavenger, V8.GCBackgroundScavenger, 0, 10000, 101) \
HR(background_sweeping, V8.GCBackgroundSweeping, 0, 10000, 101) \
HR(code_cache_reject_reason, V8.CodeCacheRejectReason, 1, 6, 6) \
HR(errors_thrown_per_context, V8.ErrorsThrownPerContext, 0, 200, 20) \
@ -32,13 +31,10 @@ namespace internal {
HR(gc_finalize_sweep, V8.GCFinalizeMC.Sweep, 0, 10000, 101) \
HR(gc_scavenger_scavenge_main, V8.GCScavenger.ScavengeMain, 0, 10000, 101) \
HR(gc_scavenger_scavenge_roots, V8.GCScavenger.ScavengeRoots, 0, 10000, 101) \
HR(gc_mark_compactor, V8.GCMarkCompactor, 0, 10000, 101) \
HR(gc_marking_sum, V8.GCMarkingSum, 0, 10000, 101) \
/* Range and bucket matches BlinkGC.MainThreadMarkingThroughput. */ \
HR(gc_main_thread_marking_throughput, V8.GCMainThreadMarkingThroughput, 0, \
100000, 50) \
HR(scavenge_reason, V8.GCScavengeReason, 0, \
kGarbageCollectionReasonMaxValue, kGarbageCollectionReasonMaxValue + 1) \
HR(young_generation_handling, V8.GCYoungGenerationHandling, 0, 2, 3) \
/* Asm/Wasm. */ \
HR(wasm_functions_per_asm_module, V8.WasmFunctionsPerModule.asm, 1, 1000000, \
@ -172,9 +168,6 @@ namespace internal {
V8.GCFinalizeMCReduceMemoryBackground, 10000, MILLISECOND) \
HT(gc_finalize_reduce_memory_foreground, \
V8.GCFinalizeMCReduceMemoryForeground, 10000, MILLISECOND) \
HT(gc_scavenger, V8.GCScavenger, 10000, MILLISECOND) \
HT(gc_scavenger_background, V8.GCScavengerBackground, 10000, MILLISECOND) \
HT(gc_scavenger_foreground, V8.GCScavengerForeground, 10000, MILLISECOND) \
HT(measure_memory_delay_ms, V8.MeasureMemoryDelayMilliseconds, 100000, \
MILLISECOND) \
HT(gc_time_to_global_safepoint, V8.GC.TimeToGlobalSafepoint, 10000000, \

View File

@ -568,29 +568,5 @@ TEST_F(GCTracerTest, RecordScavengerHistograms) {
GcHistogram::CleanUp();
}
TEST_F(GCTracerTest, RecordGCSumHistograms) {
if (FLAG_stress_incremental_marking) return;
isolate()->SetCreateHistogramFunction(&GcHistogram::CreateHistogram);
isolate()->SetAddHistogramSampleFunction(&GcHistogram::AddHistogramSample);
GCTracer* tracer = i_isolate()->heap()->tracer();
tracer->ResetForTesting();
StartTracing(tracer, GarbageCollector::MARK_COMPACTOR,
StartTracingMode::kIncrementalStart);
tracer->current_
.incremental_marking_scopes[GCTracer::Scope::MC_INCREMENTAL_START]
.duration = 1;
tracer->current_
.incremental_marking_scopes[GCTracer::Scope::MC_INCREMENTAL_SWEEPING]
.duration = 2;
tracer->AddIncrementalMarkingStep(3.0, 1024);
tracer->current_
.incremental_marking_scopes[GCTracer::Scope::MC_INCREMENTAL_FINALIZE]
.duration = 4;
const double atomic_pause_duration = 5.0;
tracer->RecordGCSumCounters(atomic_pause_duration);
EXPECT_EQ(15, GcHistogram::Get("V8.GCMarkCompactor")->Total());
GcHistogram::CleanUp();
}
} // namespace internal
} // namespace v8