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

Side by Side 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 unified diff | Download patch
« runtime/vm/flag_list.h ('K') | « runtime/vm/flag_list.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/isolate.h" 5 #include "vm/isolate.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "platform/assert.h" 9 #include "platform/assert.h"
10 #include "platform/text_buffer.h" 10 #include "platform/text_buffer.h"
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 #ifndef PRODUCT 1170 #ifndef PRODUCT
1171 if (FLAG_support_timeline) { 1171 if (FLAG_support_timeline) {
1172 TimelineStream* stream = Timeline::GetIsolateStream(); 1172 TimelineStream* stream = Timeline::GetIsolateStream();
1173 ASSERT(stream != NULL); 1173 ASSERT(stream != NULL);
1174 TimelineEvent* event = stream->StartEvent(); 1174 TimelineEvent* event = stream->StartEvent();
1175 if (event != NULL) { 1175 if (event != NULL) {
1176 event->Instant("Runnable"); 1176 event->Instant("Runnable");
1177 event->Complete(); 1177 event->Complete();
1178 } 1178 }
1179 } 1179 }
1180 if (FLAG_print_benchmarking_metrics) {
1181 // is_service_isolate not set yet.
1182 if (!ServiceIsolate::NameEquals(name())) {
Florian Schneider 2016/12/14 18:22:47 Maybe only print the metrics for the main isolate?
1183 int64_t uptime = OS::GetCurrentTimeMicros() - start_time();
1184 OS::Print("MakeRunnable(Latency): %" Pd64 " us.\n", uptime);
1185 {
1186 StartIsolateScope scope(this);
1187 heap()->CollectAllGarbage();
1188 }
1189 int64_t heap_size = (heap()->UsedInWords(Heap::kNew) * kWordSize) +
1190 (heap()->UsedInWords(Heap::kOld) * kWordSize);
1191 OS::Print("MakeRunnable(HeapSize): %" Pd64 " B.\n", heap_size);
1192 }
1193 }
1180 if (FLAG_support_service && Service::isolate_stream.enabled()) { 1194 if (FLAG_support_service && Service::isolate_stream.enabled()) {
1181 ServiceEvent runnableEvent(this, ServiceEvent::kIsolateRunnable); 1195 ServiceEvent runnableEvent(this, ServiceEvent::kIsolateRunnable);
1182 Service::HandleEvent(&runnableEvent); 1196 Service::HandleEvent(&runnableEvent);
1183 } 1197 }
1184 #endif // !PRODUCT 1198 #endif // !PRODUCT
1185 return true; 1199 return true;
1186 } 1200 }
1187 1201
1188 1202
1189 bool Isolate::VerifyPauseCapability(const Object& capability) const { 1203 bool Isolate::VerifyPauseCapability(const Object& capability) const {
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after
2942 void IsolateSpawnState::DecrementSpawnCount() { 2956 void IsolateSpawnState::DecrementSpawnCount() {
2943 ASSERT(spawn_count_monitor_ != NULL); 2957 ASSERT(spawn_count_monitor_ != NULL);
2944 ASSERT(spawn_count_ != NULL); 2958 ASSERT(spawn_count_ != NULL);
2945 MonitorLocker ml(spawn_count_monitor_); 2959 MonitorLocker ml(spawn_count_monitor_);
2946 ASSERT(*spawn_count_ > 0); 2960 ASSERT(*spawn_count_ > 0);
2947 *spawn_count_ = *spawn_count_ - 1; 2961 *spawn_count_ = *spawn_count_ - 1;
2948 ml.Notify(); 2962 ml.Notify();
2949 } 2963 }
2950 2964
2951 } // namespace dart 2965 } // namespace dart
OLDNEW
« runtime/vm/flag_list.h ('K') | « runtime/vm/flag_list.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698