Bug 1322471 - Report the true thread name for content process threads in the profile, and add a processType field. r?BenWa draft
authorMarkus Stange <mstange@themasta.com>
Wed, 07 Dec 2016 21:40:20 -1000
changeset 447868 5906497e7bf131af1a520348b09d84dc99191444
parent 447867 9493898d552927ec731a5cab894a83b3f542aa05
child 539160 480c6b07f2b8d9232983f3df35f3210823ed589c
push id38202
push userbmo:mstange@themasta.com
push dateThu, 08 Dec 2016 09:24:29 +0000
reviewersBenWa
bugs1322471
milestone53.0a1
Bug 1322471 - Report the true thread name for content process threads in the profile, and add a processType field. r?BenWa MozReview-Commit-ID: 52Eb3Rks9mE
tools/profiler/core/ThreadProfile.cpp
--- a/tools/profiler/core/ThreadProfile.cpp
+++ b/tools/profiler/core/ThreadProfile.cpp
@@ -103,31 +103,20 @@ void ThreadProfile::StreamJSON(Spliceabl
 
   mUniqueStacks.reset();
 }
 
 void ThreadProfile::StreamSamplesAndMarkers(SpliceableJSONWriter& aWriter, double aSinceTime,
                                             UniqueStacks& aUniqueStacks)
 {
 #ifndef SPS_STANDALONE
-  // Thread meta data
-  if (XRE_GetProcessType() == GeckoProcessType_Plugin) {
-    // TODO Add the proper plugin name
-    aWriter.StringProperty("name", "Plugin");
-  } else if (XRE_GetProcessType() == GeckoProcessType_Content) {
-    // This isn't going to really help once we have multiple content
-    // processes, but it'll do for now.
-    aWriter.StringProperty("name", "Content");
-  } else {
-    aWriter.StringProperty("name", Name());
-  }
-#else
-  aWriter.StringProperty("name", Name());
+  aWriter.StringProperty("processType", XRE_ChildProcessTypeToString(XRE_GetProcessType()));
 #endif
 
+  aWriter.StringProperty("name", Name());
   aWriter.IntProperty("tid", static_cast<int>(mThreadId));
 
   aWriter.StartObjectProperty("samples");
   {
     {
       JSONSchemaWriter schema(aWriter);
       schema.WriteField("stack");
       schema.WriteField("time");