Bug 1451853 - Include Firefox build id and source URL in profiler meta information. r=mstange
authorPanos Astithas <past@mozilla.com>
Thu, 10 May 2018 21:37:35 -0700
changeset 794479 2ae61c08d9f694d5964fbe8a9a58f573db26b1a0
parent 794478 09566acf52e7f91254100e318827e545056f1cf7
child 794480 9c6a3bba21378468772c73584f91dc0d09d1f781
push id109697
push userbmo:sledru@mozilla.com
push dateSat, 12 May 2018 10:04:34 +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");