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

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

Issue 2554983002: Created methods to surface zone memory information for each isolate and thread in JSON. (Closed)
Patch Set: Created methods to surface zone memory information for each isolate and thread in JSON. 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
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/service.cc » ('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 "platform/assert.h" 5 #include "platform/assert.h"
6 6
7 #include "include/dart_native_api.h" 7 #include "include/dart_native_api.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/debugger.h" 9 #include "vm/debugger.h"
10 #include "vm/json_stream.h" 10 #include "vm/json_stream.h"
11 #include "vm/message.h" 11 #include "vm/message.h"
12 #include "vm/metrics.h" 12 #include "vm/metrics.h"
13 #include "vm/object.h" 13 #include "vm/object.h"
14 #include "vm/safepoint.h" 14 #include "vm/safepoint.h"
15 #include "vm/service.h" 15 #include "vm/service.h"
16 #include "vm/service_event.h" 16 #include "vm/service_event.h"
17 #include "vm/thread_registry.h"
17 #include "vm/timeline.h" 18 #include "vm/timeline.h"
18 #include "vm/unicode.h" 19 #include "vm/unicode.h"
19 20
20 21
21 namespace dart { 22 namespace dart {
22 23
23 #ifndef PRODUCT 24 #ifndef PRODUCT
24 25
25 void AppendJSONStreamConsumer(Dart_StreamConsumer_State state, 26 void AppendJSONStreamConsumer(Dart_StreamConsumer_State state,
26 const char* stream_name, 27 const char* stream_name,
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 queue->PrintJSON(this); 534 queue->PrintJSON(this);
534 } 535 }
535 536
536 537
537 void JSONStream::PrintValue(Isolate* isolate, bool ref) { 538 void JSONStream::PrintValue(Isolate* isolate, bool ref) {
538 PrintCommaIfNeeded(); 539 PrintCommaIfNeeded();
539 isolate->PrintJSON(this, ref); 540 isolate->PrintJSON(this, ref);
540 } 541 }
541 542
542 543
544 void JSONStream::PrintValue(ThreadRegistry* reg) {
545 PrintCommaIfNeeded();
546 reg->PrintJSON(this);
547 }
548
549
550 void JSONStream::PrintValue(Thread* thread) {
551 PrintCommaIfNeeded();
552 thread->PrintJSON(this);
553 }
554
555
556 void JSONStream::PrintValue(Zone* zone) {
557 PrintCommaIfNeeded();
558 zone->PrintJSON(this);
559 }
560
561
543 void JSONStream::PrintValue(const TimelineEvent* timeline_event) { 562 void JSONStream::PrintValue(const TimelineEvent* timeline_event) {
544 PrintCommaIfNeeded(); 563 PrintCommaIfNeeded();
545 timeline_event->PrintJSON(this); 564 timeline_event->PrintJSON(this);
546 } 565 }
547 566
548 567
549 void JSONStream::PrintValue(const TimelineEventBlock* timeline_event_block) { 568 void JSONStream::PrintValue(const TimelineEventBlock* timeline_event_block) {
550 PrintCommaIfNeeded(); 569 PrintCommaIfNeeded();
551 timeline_event_block->PrintJSON(this); 570 timeline_event_block->PrintJSON(this);
552 } 571 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 PrintValue(queue); 675 PrintValue(queue);
657 } 676 }
658 677
659 678
660 void JSONStream::PrintProperty(const char* name, Isolate* isolate) { 679 void JSONStream::PrintProperty(const char* name, Isolate* isolate) {
661 PrintPropertyName(name); 680 PrintPropertyName(name);
662 PrintValue(isolate); 681 PrintValue(isolate);
663 } 682 }
664 683
665 684
685 void JSONStream::PrintProperty(const char* name, ThreadRegistry* reg) {
686 PrintPropertyName(name);
687 PrintValue(reg);
688 }
689
690
691 void JSONStream::PrintProperty(const char* name, Thread* thread) {
692 PrintPropertyName(name);
693 PrintValue(thread);
694 }
695
696
697 void JSONStream::PrintProperty(const char* name, Zone* zone) {
698 PrintPropertyName(name);
699 PrintValue(zone);
700 }
701
702
666 void JSONStream::PrintProperty(const char* name, 703 void JSONStream::PrintProperty(const char* name,
667 const TimelineEvent* timeline_event) { 704 const TimelineEvent* timeline_event) {
668 PrintPropertyName(name); 705 PrintPropertyName(name);
669 PrintValue(timeline_event); 706 PrintValue(timeline_event);
670 } 707 }
671 708
672 709
673 void JSONStream::PrintProperty(const char* name, 710 void JSONStream::PrintProperty(const char* name,
674 const TimelineEventBlock* timeline_event_block) { 711 const TimelineEventBlock* timeline_event_block) {
675 PrintPropertyName(name); 712 PrintPropertyName(name);
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 ASSERT(len == len2); 1022 ASSERT(len == len2);
986 stream_->buffer_.AddChar('"'); 1023 stream_->buffer_.AddChar('"');
987 stream_->AddEscapedUTF8String(p); 1024 stream_->AddEscapedUTF8String(p);
988 stream_->buffer_.AddChar('"'); 1025 stream_->buffer_.AddChar('"');
989 free(p); 1026 free(p);
990 } 1027 }
991 1028
992 #endif // !PRODUCT 1029 #endif // !PRODUCT
993 1030
994 } // namespace dart 1031 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698