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

Unified Diff: runtime/vm/isolate.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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index aa851bfed4250cc6e7bd8dbb0b0b2c01f73a28ac..7360f82346e21de1cd626554c5af8d5c5a150f59 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -2091,6 +2091,14 @@ void Isolate::PrintJSON(JSONStream* stream, bool ref) {
}
}
}
+
+
+void Isolate::PrintThreadsInfoToJSONObject(JSONObject* obj) {
+ obj->AddPropertyF("isolate_address", "0x%" Px "",
+ reinterpret_cast<uword>(this));
siva 2016/12/07 22:12:52 Can we use isolate id instead of isolate address h
bkonyi 2016/12/08 18:04:14 Yes, I've gone ahead and switched from addresses t
+ ASSERT(thread_registry_ != NULL);
+ thread_registry_->PrintToJSONObjectLocked(obj);
+}
#endif
@@ -2488,6 +2496,20 @@ void Isolate::RemoveIsolateFromList(Isolate* isolate) {
}
+#ifndef RELEASE
+void Isolate::PrintAllIsolatesMemoryInfoToJSONLocked(JSONStream* stream) {
Cutch 2016/12/06 19:11:14 The suffix of 'Locked' is usually applied to funct
bkonyi 2016/12/08 18:04:13 Done.
+ MonitorLocker ml(isolates_list_monitor_);
+ JSONArray arr(stream);
+ Isolate* current = isolates_list_head_;
+ while (current != NULL) {
Cutch 2016/12/06 19:11:14 Please use Isolates::VisitIsolates instead of walk
bkonyi 2016/12/08 18:04:14 Done.
+ JSONObject isolate_obj(&arr);
+ current->PrintThreadsInfoToJSONObject(&isolate_obj);
+ current = current->next_;
+ }
+}
+#endif
+
+
void Isolate::DisableIsolateCreation() {
MonitorLocker ml(isolates_list_monitor_);
creation_enabled_ = false;

Powered by Google App Engine
This is Rietveld 408576698