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

Unified Diff: runtime/vm/isolate.cc

Issue 2572873003: Add --print-benchmarking-metrics to the VM for Golem. (Closed)
Patch Set: metric Created 3 years, 11 months 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 c2a4e54bc728367b565d51b2c1af48325af81cc1..75123ba20489bb95518cabc5ed2c530b754b89e8 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -1168,6 +1168,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;
}
@@ -1665,13 +1675,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");
}
« no previous file with comments | « runtime/vm/flag_list.h ('k') | runtime/vm/metrics.h » ('j') | runtime/vm/metrics.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698