Bug 1444430 - Add a profiler feature called "screenshots". r?njn
MozReview-Commit-ID: 8blNvvliuog
--- 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_; }