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

Unified Diff: runtime/vm/thread.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/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index 709d735156f35122f439b1abe52a1709a25d7ee9..aa8634e4a440d2aa010a7a959effe97d57908f8f 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -8,6 +8,7 @@
#include "vm/dart_api_state.h"
#include "vm/growable_array.h"
#include "vm/isolate.h"
+#include "vm/json_stream.h"
#include "vm/lockers.h"
#include "vm/log.h"
#include "vm/message_handler.h"
@@ -205,6 +206,25 @@ void Thread::InitVMConstants() {
}
+#if defined(DEBUG)
zra 2016/12/08 18:54:13 #ifndef PRODUCT?
bkonyi 2016/12/08 20:58:32 Done.
+// Collect information about each individual zone associated with this thread.
+void Thread::PrintJSON(JSONStream* stream, bool ref) const {
zra 2016/12/08 18:54:13 ref is unused.
bkonyi 2016/12/08 20:58:32 Removed ref.
+ JSONObject jsobj(stream);
+ jsobj.AddProperty("type", "_Thread");
+ jsobj.AddPropertyF("id", "threads/%" Pd64 "", os_thread()->trace_id());
+ Zone* zone = zone_;
+ {
+ JSONArray zone_info_array(&jsobj, "zones");
+ zone = zone_;
+ while (zone != NULL) {
+ zone_info_array.AddValue(zone);
+ zone = zone->previous();
+ }
+ }
+}
+#endif
+
+
RawGrowableObjectArray* Thread::pending_functions() {
if (pending_functions_ == GrowableObjectArray::null()) {
pending_functions_ = GrowableObjectArray::New(Heap::kOld);

Powered by Google App Engine
This is Rietveld 408576698