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

Unified Diff: runtime/vm/thread.cc

Issue 2565253004: Added task kind field to thread JSON output. (Closed)
Patch Set: 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_test.cc » ('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 765ed26213dbaa22efa19cea31c7f4e60decbc10..c8c63c58ab1912482be3706bc55d3ba673562583 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -213,6 +213,7 @@ void Thread::PrintJSON(JSONStream* stream) const {
jsobj.AddProperty("type", "_Thread");
jsobj.AddPropertyF("id", "threads/%" Pd "",
OSThread::ThreadIdToIntPtr(os_thread()->trace_id()));
+ jsobj.AddProperty("kind", TaskKindToCString(task_kind()));
Zone* zone = zone_;
{
JSONArray zone_info_array(&jsobj, "zones");
@@ -266,6 +267,27 @@ void Thread::clear_sticky_error() {
}
+const char* Thread::TaskKindToCString(TaskKind kind) {
+ switch (kind) {
+ case kUnknownTask:
+ return "kUnknownTask";
+ case kMutatorTask:
+ return "kMutatorTask";
+ case kCompilerTask:
+ return "kCompilerTask";
+ case kSweeperTask:
+ return "kSweeperTask";
+ case kMarkerTask:
+ return "kMarkerTask";
+ case kFinalizerTask:
+ return "kFinalizerTask";
+ default:
+ UNREACHABLE();
+ return "";
+ }
+}
+
+
bool Thread::EnterIsolate(Isolate* isolate) {
const bool kIsMutatorThread = true;
Thread* thread = isolate->ScheduleThread(kIsMutatorThread);
« no previous file with comments | « runtime/vm/thread.h ('k') | runtime/vm/thread_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698