| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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/metrics.h" | 5 #include "vm/metrics.h" |
| 6 | 6 |
| 7 #include "vm/isolate.h" | 7 #include "vm/isolate.h" |
| 8 #include "vm/json_stream.h" | 8 #include "vm/json_stream.h" |
| 9 #include "vm/native_entry.h" | 9 #include "vm/native_entry.h" |
| 10 #include "vm/runtime_entry.h" | 10 #include "vm/runtime_entry.h" |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 #define VM_METRIC_INIT(type, variable, name, unit) \ | 299 #define VM_METRIC_INIT(type, variable, name, unit) \ |
| 300 vm_metric_##variable##_.Init(name, NULL, Metric::unit); | 300 vm_metric_##variable##_.Init(name, NULL, Metric::unit); |
| 301 VM_METRIC_LIST(VM_METRIC_INIT); | 301 VM_METRIC_LIST(VM_METRIC_INIT); |
| 302 #undef VM_METRIC_INIT | 302 #undef VM_METRIC_INIT |
| 303 } | 303 } |
| 304 | 304 |
| 305 void Metric::Cleanup() { | 305 void Metric::Cleanup() { |
| 306 if (FLAG_print_metrics) { | 306 if (FLAG_print_metrics) { |
| 307 // Create a zone to allocate temporary strings in. | 307 // Create a zone to allocate temporary strings in. |
| 308 StackZone sz(Thread::Current()); | 308 StackZone sz(Thread::Current()); |
| 309 OS::Print("Printing metrics for VM\n"); | 309 OS::PrintErr("Printing metrics for VM\n"); |
| 310 Metric* current = Metric::vm_head(); | 310 Metric* current = Metric::vm_head(); |
| 311 while (current != NULL) { | 311 while (current != NULL) { |
| 312 OS::Print("%s\n", current->ToString()); | 312 OS::PrintErr("%s\n", current->ToString()); |
| 313 current = current->next(); | 313 current = current->next(); |
| 314 } | 314 } |
| 315 OS::Print("\n"); | 315 OS::PrintErr("\n"); |
| 316 } | 316 } |
| 317 } | 317 } |
| 318 | 318 |
| 319 | 319 |
| 320 MaxMetric::MaxMetric() | 320 MaxMetric::MaxMetric() |
| 321 : Metric() { | 321 : Metric() { |
| 322 set_value(kMinInt64); | 322 set_value(kMinInt64); |
| 323 } | 323 } |
| 324 | 324 |
| 325 | 325 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 336 } | 336 } |
| 337 | 337 |
| 338 | 338 |
| 339 void MinMetric::SetValue(int64_t new_value) { | 339 void MinMetric::SetValue(int64_t new_value) { |
| 340 if (new_value < value()) { | 340 if (new_value < value()) { |
| 341 set_value(new_value); | 341 set_value(new_value); |
| 342 } | 342 } |
| 343 } | 343 } |
| 344 | 344 |
| 345 } // namespace dart | 345 } // namespace dart |
| OLD | NEW |