From 86fdeab739f80f37fde9acd31f2808fd3959568a Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Tue, 10 Nov 2020 18:41:24 +0000 Subject: [PATCH] [vm] Remove unused --print-benchmarking-metrics flag This flag doesn't seem to be used anywhere, neither of dart/flutter/golem/g3. Main motivation is to remove the GC triggering code in Isolate::MakeRunnable. Issue https://github.com/dart-lang/sdk/issues/36097 Change-Id: If48072f62974dec5f7c19cc08be7904401e38a61 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171282 Reviewed-by: Ryan Macnak Commit-Queue: Martin Kustermann --- runtime/vm/flag_list.h | 2 -- runtime/vm/isolate.cc | 11 +---------- runtime/vm/metrics.cc | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/runtime/vm/flag_list.h b/runtime/vm/flag_list.h index 5e022399315..341b4fc3ce8 100644 --- a/runtime/vm/flag_list.h +++ b/runtime/vm/flag_list.h @@ -167,8 +167,6 @@ constexpr bool kDartUseBackgroundCompilation = true; P(print_snapshot_sizes, bool, false, "Print sizes of generated snapshots.") \ P(print_snapshot_sizes_verbose, bool, false, \ "Print cluster sizes of generated snapshots.") \ - P(print_benchmarking_metrics, bool, false, \ - "Print additional memory and latency metrics for benchmarking.") \ R(print_ssa_liveranges, false, bool, false, \ "Print live ranges after allocation.") \ R(print_stacktrace_at_api_error, false, bool, false, \ diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc index b7357769443..11991c00d28 100644 --- a/runtime/vm/isolate.cc +++ b/runtime/vm/isolate.cc @@ -2091,15 +2091,6 @@ const char* Isolate::MakeRunnable() { Service::HandleEvent(&runnableEvent); } GetRunnableLatencyMetric()->set_value(UptimeMicros()); - if (FLAG_print_benchmarking_metrics) { - { - StartIsolateScope scope(this); - heap()->CollectAllGarbage(); - } - int64_t heap_size = (heap()->UsedInWords(Heap::kNew) * kWordSize) + - (heap()->UsedInWords(Heap::kOld) * kWordSize); - GetRunnableHeapSizeMetric()->set_value(heap_size); - } #endif // !PRODUCT return nullptr; } @@ -2553,7 +2544,7 @@ void Isolate::LowLevelShutdown() { "\tisolate: %s\n", name()); } - if (FLAG_print_metrics || FLAG_print_benchmarking_metrics) { + if (FLAG_print_metrics) { LogBlock lb; OS::PrintErr("Printing metrics for %s\n", name()); #define ISOLATE_GROUP_METRIC_PRINT(type, variable, name, unit) \ diff --git a/runtime/vm/metrics.cc b/runtime/vm/metrics.cc index ecfda6c6d53..f7e582b90b3 100644 --- a/runtime/vm/metrics.cc +++ b/runtime/vm/metrics.cc @@ -206,7 +206,7 @@ void Metric::Init() { } void Metric::Cleanup() { - if (FLAG_print_metrics || FLAG_print_benchmarking_metrics) { + if (FLAG_print_metrics) { // Create a zone to allocate temporary strings in. StackZone sz(Thread::Current()); OS::PrintErr("Printing metrics for VM\n");