Bug 1444430 - Add a profiler feature called "screenshots". r?njn draft
authorMarkus Stange <mstange@themasta.com>
Thu, 12 Apr 2018 15:21:40 -0400
changeset 781544 15b8d2e91339d75a1352989615a8f96324d3bdf6
parent 781364 5e53627e64e897a82cfe7a3a6455f66778bf1fef
child 781545 1a82f74ff068a061ae8dc7c948e949afcab492fb
push id106333
push userbmo:mstange@themasta.com
push dateFri, 13 Apr 2018 04:35:01 +0000
reviewersnjn
bugs1444430
milestone61.0a1
Bug 1444430 - Add a profiler feature called "screenshots". r?njn MozReview-Commit-ID: 8blNvvliuog
browser/components/extensions/schemas/geckoProfiler.json
devtools/server/tests/browser/browser_perf-04.js
tools/profiler/public/GeckoProfiler.h
--- a/browser/components/extensions/schemas/geckoProfiler.json
+++ b/browser/components/extensions/schemas/geckoProfiler.json
@@ -25,16 +25,17 @@
         "enum": [
           "java",
           "js",
           "leaf",
           "mainthreadio",
           "memory",
           "privacy",
           "restyle",
+          "screenshots",
           "stackwalk",
           "tasktracer",
           "threads",
           "trackopts"
         ]
       }
     ],
     "functions": [
--- a/devtools/server/tests/browser/browser_perf-04.js
+++ b/devtools/server/tests/browser/browser_perf-04.js
@@ -15,17 +15,17 @@ add_task(async function() {
   is(await front.isLockedForPrivateBrowsing(), false,
     "The browser is not in private browsing mode.");
   is(await front.isActive(), false,
     "The profiler is not active yet.");
 
   front.once("profiler-started", (entries, interval, features) => {
     is(entries, 1000, "Should apply entries by startProfiler");
     is(interval, 0.1, "Should apply interval by startProfiler");
-    is(features, 0x82, "Should apply features by startProfiler");
+    is(features, 0x102, "Should apply features by startProfiler");
   });
 
   // Start the profiler.
   await front.startProfiler({ entries: 1000, interval: 0.1,
                               features: ["js", "stackwalk"] });
 
   is(await front.isActive(), true, "The profiler is active.");
 
--- a/tools/profiler/public/GeckoProfiler.h
+++ b/tools/profiler/public/GeckoProfiler.h
@@ -116,27 +116,30 @@ class TimeStamp;
   macro(4, "memory", Memory) \
   \
   /* Do not include user-identifiable information. */ \
   macro(5, "privacy", Privacy) \
   \
   /* Restyle profiling. */ \
   macro(6, "restyle", Restyle) \
   \
+  /* Take a snapshot of the window on every composition. */ \
+  macro(7, "screenshots", Screenshots) \
+  \
   /* Walk the C++ stack. Not available on all platforms. */ \
-  macro(7, "stackwalk", StackWalk) \
+  macro(8, "stackwalk", StackWalk) \
   \
   /* Start profiling with feature TaskTracer. */ \
-  macro(8, "tasktracer", TaskTracer) \
+  macro(9, "tasktracer", TaskTracer) \
   \
   /* Profile the registered secondary threads. */ \
-  macro(9, "threads", Threads) \
+  macro(10, "threads", Threads) \
   \
   /* Have the JavaScript engine track JIT optimizations. */ \
-  macro(10, "trackopts", TrackOptimizations)
+  macro(11, "trackopts", TrackOptimizations)
 
 struct ProfilerFeature
 {
   #define DECLARE(n_, str_, Name_) \
     static const uint32_t Name_ = (1u << n_); \
     static bool Has##Name_(uint32_t aFeatures) { return aFeatures & Name_; } \
     static void Set##Name_(uint32_t& aFeatures) { aFeatures |= Name_; } \
     static void Clear##Name_(uint32_t& aFeatures) { aFeatures &= ~Name_; }