Bug 1913624 - Remove expired telemetry histogram PRESSHELL_LAYOUT_TOTAL_MS_PER_TICK, r=TravisLong.
Depends on D219468 Differential Revision: https://phabricator.services.mozilla.com/D219469
This commit is contained in:
@@ -1,101 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/layout/LayoutTelemetryTools.h"
|
||||
|
||||
#include "MainThreadUtils.h"
|
||||
#include "mozilla/EnumeratedArray.h"
|
||||
#include "mozilla/EnumeratedRange.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
namespace mozilla::layout_telemetry {
|
||||
|
||||
using LayoutSubsystemDurations =
|
||||
EnumeratedArray<LayoutSubsystem, double, size_t(LayoutSubsystem::Count)>;
|
||||
|
||||
struct PerTickData {
|
||||
constexpr PerTickData() = default;
|
||||
LayoutSubsystemDurations mLayoutSubsystemDurationMs{0.0, 0.0, 0.0,
|
||||
0.0, 0.0, 0.0};
|
||||
};
|
||||
|
||||
static PerTickData sData;
|
||||
static AutoRecord* sCurrentRecord;
|
||||
|
||||
// Returns the key name expected by telemetry. Keep to date with
|
||||
// toolkits/components/telemetry/Histograms.json.
|
||||
static nsLiteralCString SubsystemTelemetryKey(LayoutSubsystem aSubsystem) {
|
||||
switch (aSubsystem) {
|
||||
default:
|
||||
MOZ_CRASH("Unexpected LayoutSubsystem value");
|
||||
case LayoutSubsystem::Restyle:
|
||||
return "Restyle"_ns;
|
||||
case LayoutSubsystem::Reflow:
|
||||
return "ReflowOther"_ns;
|
||||
case LayoutSubsystem::ReflowFlex:
|
||||
return "ReflowFlex"_ns;
|
||||
case LayoutSubsystem::ReflowGrid:
|
||||
return "ReflowGrid"_ns;
|
||||
case LayoutSubsystem::ReflowTable:
|
||||
return "ReflowTable"_ns;
|
||||
case LayoutSubsystem::ReflowText:
|
||||
return "ReflowText"_ns;
|
||||
}
|
||||
}
|
||||
|
||||
void PingPerTickTelemetry() {
|
||||
auto range =
|
||||
MakeEnumeratedRange(LayoutSubsystem::Restyle, LayoutSubsystem::Count);
|
||||
for (auto subsystem : range) {
|
||||
auto key = SubsystemTelemetryKey(subsystem);
|
||||
double& duration = sData.mLayoutSubsystemDurationMs[subsystem];
|
||||
if (duration > 0.0) {
|
||||
Telemetry::Accumulate(Telemetry::PRESSHELL_LAYOUT_TOTAL_MS_PER_TICK, key,
|
||||
static_cast<uint32_t>(duration));
|
||||
duration = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AutoRecord::AutoRecord(LayoutSubsystem aSubsystem)
|
||||
: mParentRecord(sCurrentRecord), mSubsystem(aSubsystem) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
// If we're re-entering the same subsystem, don't update the current record.
|
||||
if (mParentRecord && mParentRecord->mSubsystem == mSubsystem) {
|
||||
return;
|
||||
}
|
||||
|
||||
mStartTime = TimeStamp::Now();
|
||||
if (mParentRecord) {
|
||||
// If we're entering a new subsystem, record the amount of time spent in the
|
||||
// parent record before setting the new current record.
|
||||
mParentRecord->mDurationMs +=
|
||||
(mStartTime - mParentRecord->mStartTime).ToMilliseconds();
|
||||
}
|
||||
|
||||
sCurrentRecord = this;
|
||||
}
|
||||
|
||||
AutoRecord::~AutoRecord() {
|
||||
if (sCurrentRecord != this) {
|
||||
// If this record is not head of the list, do nothing.
|
||||
return;
|
||||
}
|
||||
|
||||
TimeStamp now = TimeStamp::Now();
|
||||
mDurationMs += (now - mStartTime).ToMilliseconds();
|
||||
sData.mLayoutSubsystemDurationMs[mSubsystem] += mDurationMs;
|
||||
|
||||
if (mParentRecord) {
|
||||
// Restart the parent recording from this point
|
||||
mParentRecord->mStartTime = now;
|
||||
}
|
||||
|
||||
// Unlink this record from the current record list
|
||||
sCurrentRecord = mParentRecord;
|
||||
}
|
||||
|
||||
} // namespace mozilla::layout_telemetry
|
||||
@@ -1,47 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
/* Tools for collecting and reporting layout and style telemetry */
|
||||
|
||||
#ifndef mozilla_LayoutTelemetryTools_h
|
||||
#define mozilla_LayoutTelemetryTools_h
|
||||
|
||||
#include "mozilla/TimeStamp.h"
|
||||
|
||||
#define LAYOUT_TELEMETRY_RECORD(subsystem) \
|
||||
mozilla::layout_telemetry::AutoRecord a( \
|
||||
mozilla::layout_telemetry::LayoutSubsystem::subsystem)
|
||||
|
||||
namespace mozilla::layout_telemetry {
|
||||
|
||||
// Send the current per-tick telemetry.
|
||||
void PingPerTickTelemetry();
|
||||
|
||||
enum class LayoutSubsystem : uint8_t {
|
||||
Restyle,
|
||||
Reflow,
|
||||
ReflowFlex,
|
||||
ReflowGrid,
|
||||
ReflowTable,
|
||||
ReflowText,
|
||||
Count
|
||||
};
|
||||
|
||||
class AutoRecord {
|
||||
public:
|
||||
explicit AutoRecord(LayoutSubsystem aSubsystem);
|
||||
~AutoRecord();
|
||||
|
||||
private:
|
||||
AutoRecord* const mParentRecord;
|
||||
const LayoutSubsystem mSubsystem;
|
||||
TimeStamp mStartTime;
|
||||
double mDurationMs = 0.0;
|
||||
};
|
||||
|
||||
} // namespace mozilla::layout_telemetry
|
||||
|
||||
#endif // !mozilla_LayoutTelemetryTools_h
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "mozilla/ContentIterator.h"
|
||||
#include "mozilla/css/ImageLoader.h"
|
||||
#include "mozilla/DisplayPortUtils.h"
|
||||
#include "mozilla/layout/LayoutTelemetryTools.h"
|
||||
#include "mozilla/dom/AncestorIterator.h"
|
||||
#include "mozilla/dom/BrowserBridgeChild.h"
|
||||
#include "mozilla/dom/BrowserChild.h"
|
||||
@@ -4368,7 +4367,6 @@ void PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush aFlush) {
|
||||
AutoProfilerStyleMarker tracingStyleFlush(std::move(mStyleCause),
|
||||
innerWindowID);
|
||||
PerfStats::AutoMetricRecording<PerfStats::Metric::Styling> autoRecording;
|
||||
LAYOUT_TELEMETRY_RECORD(Restyle);
|
||||
|
||||
mPresContext->RestyleManager()->ProcessPendingRestyles();
|
||||
mNeedStyleFlush = false;
|
||||
@@ -9811,8 +9809,6 @@ bool PresShell::DoReflow(nsIFrame* target, bool aInterruptible,
|
||||
AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING_RELEVANT_FOR_JS(
|
||||
"Reflow", LAYOUT_Reflow, uri ? uri->GetSpecOrDefault() : "N/A"_ns);
|
||||
|
||||
LAYOUT_TELEMETRY_RECORD(Reflow);
|
||||
|
||||
PerfStats::AutoMetricRecording<PerfStats::Metric::Reflowing> autoRecording;
|
||||
|
||||
gfxTextPerfMetrics* tp = mPresContext->GetTextPerfMetrics();
|
||||
|
||||
@@ -95,10 +95,6 @@ EXPORTS.mozilla += [
|
||||
"ViewportUtils.h",
|
||||
]
|
||||
|
||||
EXPORTS.mozilla.layout += [
|
||||
"LayoutTelemetryTools.h",
|
||||
]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
"AccessibleCaret.cpp",
|
||||
"AccessibleCaretEventHub.cpp",
|
||||
@@ -110,7 +106,6 @@ UNIFIED_SOURCES += [
|
||||
"GeckoMVMContext.cpp",
|
||||
"GeometryUtils.cpp",
|
||||
"LayoutLogging.cpp",
|
||||
"LayoutTelemetryTools.cpp",
|
||||
"MobileViewportManager.cpp",
|
||||
"MotionPathUtils.cpp",
|
||||
"nsBidiPresUtils.cpp",
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/AutoRestore.h"
|
||||
#include "mozilla/BasePrincipal.h"
|
||||
#include "mozilla/layout/LayoutTelemetryTools.h"
|
||||
#include "mozilla/dom/MediaQueryList.h"
|
||||
#include "mozilla/CycleCollectedJSContext.h"
|
||||
#include "mozilla/DisplayPortUtils.h"
|
||||
@@ -2811,8 +2810,6 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime,
|
||||
|
||||
UpdateAnimatedImages(previousRefresh, aNowTime);
|
||||
|
||||
layout_telemetry::PingPerTickTelemetry();
|
||||
|
||||
bool dispatchTasksAfterTick = false;
|
||||
if (mViewManagerFlushIsPending && !mThrottled) {
|
||||
nsCString transactionId;
|
||||
|
||||
@@ -15563,26 +15563,6 @@
|
||||
"releaseChannelCollection": "opt-out",
|
||||
"description": "Numbers of HTTP transactions and connections by type. There are some categories separated by labels based on 5 parameters: 1. normal browsing or private browsing 2. system principal or not 3. first party or third party 4. class of service (Leader/Background/Others) 5. tracking classification (Basic/Content/FingerprintingContent)."
|
||||
},
|
||||
"PRESSHELL_LAYOUT_TOTAL_MS_PER_TICK": {
|
||||
"record_in_processes": ["main", "content"],
|
||||
"products": ["firefox", "fennec"],
|
||||
"alert_emails": ["layout-telemetry-alerts@mozilla.com"],
|
||||
"bug_numbers": [1578319, 1616147],
|
||||
"expires_in_version": "82",
|
||||
"keyed": true,
|
||||
"keys": [
|
||||
"Restyle",
|
||||
"ReflowOther",
|
||||
"ReflowFlex",
|
||||
"ReflowGrid",
|
||||
"ReflowTable",
|
||||
"ReflowText"
|
||||
],
|
||||
"kind": "exponential",
|
||||
"high": 1000,
|
||||
"n_buckets": 50,
|
||||
"description": "Time in milliseconds spent in the layout system per Refresh Driver tick."
|
||||
},
|
||||
"COOKIE_PURGING_ORIGINS_PURGED": {
|
||||
"expires_in_version": "never",
|
||||
"record_in_processes": ["main"],
|
||||
|
||||
Reference in New Issue
Block a user