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

Side by Side Diff: runtime/vm/isolate.cc

Issue 1303033005: Add --print-metrics vm flag for printing metrics to console (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/metrics.h » ('j') | 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 "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/json.h" 9 #include "platform/json.h"
10 #include "vm/code_observers.h" 10 #include "vm/code_observers.h"
(...skipping 26 matching lines...) Expand all
37 #include "vm/tags.h" 37 #include "vm/tags.h"
38 #include "vm/thread_interrupter.h" 38 #include "vm/thread_interrupter.h"
39 #include "vm/thread_registry.h" 39 #include "vm/thread_registry.h"
40 #include "vm/timeline.h" 40 #include "vm/timeline.h"
41 #include "vm/timer.h" 41 #include "vm/timer.h"
42 #include "vm/visitor.h" 42 #include "vm/visitor.h"
43 43
44 44
45 namespace dart { 45 namespace dart {
46 46
47 DECLARE_FLAG(charp, timeline_trace_dir); 47 DECLARE_FLAG(bool, print_metrics);
48 48
49 DEFINE_FLAG(bool, trace_isolates, false, 49 DEFINE_FLAG(bool, trace_isolates, false,
50 "Trace isolate creation and shut down."); 50 "Trace isolate creation and shut down.");
51 DEFINE_FLAG(bool, pause_isolates_on_start, false, 51 DEFINE_FLAG(bool, pause_isolates_on_start, false,
52 "Pause isolates before starting."); 52 "Pause isolates before starting.");
53 DEFINE_FLAG(bool, pause_isolates_on_exit, false, 53 DEFINE_FLAG(bool, pause_isolates_on_exit, false,
54 "Pause isolates exiting."); 54 "Pause isolates exiting.");
55 DEFINE_FLAG(bool, break_at_isolate_spawn, false, 55 DEFINE_FLAG(bool, break_at_isolate_spawn, false,
56 "Insert a one-time breakpoint at the entrypoint for all spawned " 56 "Insert a one-time breakpoint at the entrypoint for all spawned "
57 "isolates"); 57 "isolates");
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 api_state()->weak_persistent_handles().VisitHandles(&visitor); 1533 api_state()->weak_persistent_handles().VisitHandles(&visitor);
1534 api_state()->prologue_weak_persistent_handles().VisitHandles(&visitor); 1534 api_state()->prologue_weak_persistent_handles().VisitHandles(&visitor);
1535 1535
1536 if (FLAG_trace_isolates) { 1536 if (FLAG_trace_isolates) {
1537 heap()->PrintSizes(); 1537 heap()->PrintSizes();
1538 megamorphic_cache_table()->PrintSizes(); 1538 megamorphic_cache_table()->PrintSizes();
1539 Symbols::DumpStats(); 1539 Symbols::DumpStats();
1540 OS::Print("[-] Stopping isolate:\n" 1540 OS::Print("[-] Stopping isolate:\n"
1541 "\tisolate: %s\n", name()); 1541 "\tisolate: %s\n", name());
1542 } 1542 }
1543 if (FLAG_print_metrics) {
1544 LogBlock lb(this);
1545 ISL_Print("Printing metrics for %s\n", name());
1546 #define ISOLATE_METRIC_PRINT(type, variable, name, unit) \
1547 ISL_Print("%s\n", metric_##variable##_.ToString());
1548 ISOLATE_METRIC_LIST(ISOLATE_METRIC_PRINT);
1549 #undef ISOLATE_METRIC_PRINT
1550 ISL_Print("\n");
1551 }
1543 } 1552 }
1544 1553
1545 #if defined(DEBUG) 1554 #if defined(DEBUG)
1546 // No concurrent sweeper tasks should be running at this point. 1555 // No concurrent sweeper tasks should be running at this point.
1547 if (heap_ != NULL) { 1556 if (heap_ != NULL) {
1548 PageSpace* old_space = heap_->old_space(); 1557 PageSpace* old_space = heap_->old_space();
1549 MonitorLocker ml(old_space->tasks_lock()); 1558 MonitorLocker ml(old_space->tasks_lock());
1550 ASSERT(old_space->tasks() == 0); 1559 ASSERT(old_space->tasks() == 0);
1551 } 1560 }
1552 #endif 1561 #endif
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
2153 serialized_message_, serialized_message_len_); 2162 serialized_message_, serialized_message_len_);
2154 } 2163 }
2155 2164
2156 2165
2157 void IsolateSpawnState::Cleanup() { 2166 void IsolateSpawnState::Cleanup() {
2158 SwitchIsolateScope switch_scope(I); 2167 SwitchIsolateScope switch_scope(I);
2159 Dart::ShutdownIsolate(); 2168 Dart::ShutdownIsolate();
2160 } 2169 }
2161 2170
2162 } // namespace dart 2171 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/metrics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698