Bug 1451853 - Include Firefox build id and source URL in profiler meta information. r?mstange draft
authorPanos Astithas <past@mozilla.com>
Thu, 10 May 2018 21:37:35 -0700
changeset 794243 f5631ffaff39baef94b556226233e21abbd927fe
parent 792573 7c83ceac4be6d055bebd870a82b78b76de14b9d7
push id109625
push userbmo:past@mozilla.com
push dateFri, 11 May 2018 16:18:05 +0000
reviewersmstange
bugs1451853
milestone62.0a1
Bug 1451853 - Include Firefox build id and source URL in profiler meta information. r?mstange MozReview-Commit-ID: 5MBM31f2UjP
tools/profiler/core/platform.cpp
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -1545,16 +1545,20 @@ StreamTaskTracer(PSLockRef aLock, Splice
 static void
 StreamMetaJSCustomObject(PSLockRef aLock, SpliceableJSONWriter& aWriter,
                          bool aIsShuttingDown)
 {
   MOZ_RELEASE_ASSERT(CorePS::Exists() && ActivePS::Exists(aLock));
 
   aWriter.IntProperty("version", 9);
 
+#if defined(MOZ_SOURCE_URL)
+  aWriter.StringProperty("sourceURL", "@MOZ_SOURCE_URL@");
+#endif
+
   // The "startTime" field holds the number of milliseconds since midnight
   // January 1, 1970 GMT. This grotty code computes (Now - (Now -
   // ProcessStartTime)) to convert CorePS::ProcessStartTime() into that form.
   TimeDuration delta = TimeStamp::Now() - CorePS::ProcessStartTime();
   aWriter.DoubleProperty(
     "startTime", static_cast<double>(PR_Now()/1000.0 - delta.ToMilliseconds()));
 
   // Write the shutdownTime field. Unlike startTime, shutdownTime is not an
@@ -1631,16 +1635,20 @@ StreamMetaJSCustomObject(PSLockRef aLock
   nsCOMPtr<nsIXULAppInfo> appInfo =
     do_GetService("@mozilla.org/xre/app-info;1");
 
   if (appInfo) {
     nsAutoCString string;
     res = appInfo->GetName(string);
     if (!NS_FAILED(res))
       aWriter.StringProperty("product", string.Data());
+
+    res = appInfo->GetAppBuildID(string);
+    if (!NS_FAILED(res))
+      aWriter.StringProperty("appBuildID", string.Data());
   }
 
   aWriter.StartObjectProperty("extensions");
   {
     {
       JSONSchemaWriter schema(aWriter);
       schema.WriteField("id");
       schema.WriteField("name");