Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(834)

Unified Diff: runtime/vm/isolate.cc

Issue 2572873003: Add --print-benchmarking-metrics to the VM for Golem. (Closed)
Patch Set: . Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 8304532470999c81ea515843ad6496c8348db0f3..11dce365923c0389d13287f21323aec3ea493f26 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -1187,6 +1187,16 @@ bool Isolate::MakeRunnable() {
Service::HandleEvent(&runnableEvent);
}
#endif // !PRODUCT
+ 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);
+ }
return true;
}
@@ -1682,13 +1692,12 @@ void Isolate::LowLevelShutdown() {
"\tisolate: %s\n",
name());
}
- if (FLAG_print_metrics) {
+ if (FLAG_print_metrics || FLAG_print_benchmarking_metrics) {
LogBlock lb;
OS::PrintErr("Printing metrics for %s\n", name());
#define ISOLATE_METRIC_PRINT(type, variable, name, unit) \
OS::PrintErr("%s\n", metric_##variable##_.ToString());
-
- ISOLATE_METRIC_LIST(ISOLATE_METRIC_PRINT);
+ ISOLATE_METRIC_LIST(ISOLATE_METRIC_PRINT)
#undef ISOLATE_METRIC_PRINT
OS::PrintErr("\n");
}

Powered by Google App Engine
This is Rietveld 408576698