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

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

Issue 2148613002: Have --print-metrics use stderr to work around issue with analyzer_cli (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rmacnak review Created 4 years, 5 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/isolate.cc ('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) 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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698