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

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
« no previous file with comments | « runtime/vm/thread.h ('k') | runtime/vm/thread_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index 709d735156f35122f439b1abe52a1709a25d7ee9..c09a9f02593c1a6907ba2468cc90bb15dccd5026 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() {
}
+#ifndef PRODUCT
+// Collect information about each individual zone associated with this thread.
+void Thread::PrintJSON(JSONStream* stream) const {
+ 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);
« no previous file with comments | « runtime/vm/thread.h ('k') | runtime/vm/thread_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698