Bug 1322471 - Report the true thread name for content process threads in the profile, and add a processType field. r=BenWa
authorMarkus Stange <mstange@themasta.com>
Wed, 07 Dec 2016 21:40:20 -1000
changeset 325430 833fef6e27005ca00af9a423f7eb9be588b7c631
parent 325429 fa4c79383dbe530bef19fe1979b8d7cc8e87561a
child 325431 3be54c62e0011dca5367be2a04e54bc6882f1908
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +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");