Bug 1553254 - Part 2: Add some first performance probes to our codebase for some basic, easy to measure things. r=brennie

Differential Revision: https://phabricator.services.mozilla.com/D32877

--HG--
extra : rebase_source : b2d474400a2b09eeb5194845c1c4cd717de00513
This commit is contained in:
Bas Schouten 2019-05-28 20:58:06 +02:00
Родитель 202c0599be
Коммит 88c1c3d944
6 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -22,6 +22,7 @@
#include "mozilla/layers/LayerTransactionChild.h" #include "mozilla/layers/LayerTransactionChild.h"
#include "mozilla/layers/PersistentBufferProvider.h" #include "mozilla/layers/PersistentBufferProvider.h"
#include "mozilla/layers/SyncObject.h" #include "mozilla/layers/SyncObject.h"
#include "mozilla/PerfStats.h"
#include "ClientReadbackLayer.h" // for ClientReadbackLayer #include "ClientReadbackLayer.h" // for ClientReadbackLayer
#include "nsAString.h" #include "nsAString.h"
#include "nsDisplayList.h" #include "nsDisplayList.h"
@ -278,6 +279,7 @@ bool ClientLayerManager::EndTransactionInternal(
PaintTelemetry::AutoRecord record(PaintTelemetry::Metric::Rasterization); PaintTelemetry::AutoRecord record(PaintTelemetry::Metric::Rasterization);
AUTO_PROFILER_TRACING("Paint", "Rasterize", GRAPHICS); AUTO_PROFILER_TRACING("Paint", "Rasterize", GRAPHICS);
PerfStats::AutoMetricRecording<PerfStats::Metric::Rasterizing> autoRecording;
Maybe<TimeStamp> startTime; Maybe<TimeStamp> startTime;
if (StaticPrefs::LayersDrawFPS()) { if (StaticPrefs::LayersDrawFPS()) {

Просмотреть файл

@ -65,6 +65,7 @@
#include "mozilla/webrender/WebRenderAPI.h" #include "mozilla/webrender/WebRenderAPI.h"
#include "mozilla/media/MediaSystemResourceService.h" // for MediaSystemResourceService #include "mozilla/media/MediaSystemResourceService.h" // for MediaSystemResourceService
#include "mozilla/mozalloc.h" // for operator new, etc #include "mozilla/mozalloc.h" // for operator new, etc
#include "mozilla/PerfStats.h"
#include "mozilla/Telemetry.h" #include "mozilla/Telemetry.h"
#ifdef MOZ_WIDGET_GTK #ifdef MOZ_WIDGET_GTK
# include "basic/X11BasicCompositor.h" // for X11BasicCompositor # include "basic/X11BasicCompositor.h" // for X11BasicCompositor
@ -912,6 +913,7 @@ void CompositorBridgeParent::CompositeToTarget(VsyncId aId, DrawTarget* aTarget,
const gfx::IntRect* aRect) { const gfx::IntRect* aRect) {
AUTO_PROFILER_TRACING("Paint", "Composite", GRAPHICS); AUTO_PROFILER_TRACING("Paint", "Composite", GRAPHICS);
AUTO_PROFILER_LABEL("CompositorBridgeParent::CompositeToTarget", GRAPHICS); AUTO_PROFILER_LABEL("CompositorBridgeParent::CompositeToTarget", GRAPHICS);
PerfStats::AutoMetricRecording<PerfStats::Metric::Compositing> autoRecording;
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread(), MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread(),
"Composite can only be called on the compositor thread"); "Composite can only be called on the compositor thread");

Просмотреть файл

@ -25,6 +25,7 @@
#include "mozilla/layers/TextureHostOGL.h" // for TextureHostOGL #include "mozilla/layers/TextureHostOGL.h" // for TextureHostOGL
#include "mozilla/layers/PaintedLayerComposite.h" #include "mozilla/layers/PaintedLayerComposite.h"
#include "mozilla/mozalloc.h" // for operator delete, etc #include "mozilla/mozalloc.h" // for operator delete, etc
#include "mozilla/PerfStats.h"
#include "mozilla/StaticPrefs.h" #include "mozilla/StaticPrefs.h"
#include "mozilla/Telemetry.h" #include "mozilla/Telemetry.h"
#include "mozilla/Unused.h" #include "mozilla/Unused.h"
@ -153,6 +154,8 @@ mozilla::ipc::IPCResult LayerTransactionParent::RecvUpdate(
AUTO_PROFILER_TRACING("Paint", "LayerTransaction", GRAPHICS); AUTO_PROFILER_TRACING("Paint", "LayerTransaction", GRAPHICS);
AUTO_PROFILER_LABEL("LayerTransactionParent::RecvUpdate", GRAPHICS); AUTO_PROFILER_LABEL("LayerTransactionParent::RecvUpdate", GRAPHICS);
PerfStats::AutoMetricRecording<PerfStats::Metric::LayerTransactions>
autoRecording;
TimeStamp updateStart = TimeStamp::Now(); TimeStamp updateStart = TimeStamp::Now();

Просмотреть файл

@ -23,6 +23,7 @@
#include "mozilla/Likely.h" #include "mozilla/Likely.h"
#include "mozilla/Logging.h" #include "mozilla/Logging.h"
#include "mozilla/MouseEvents.h" #include "mozilla/MouseEvents.h"
#include "mozilla/PerfStats.h"
#include "mozilla/PresShellInlines.h" #include "mozilla/PresShellInlines.h"
#include "mozilla/Sprintf.h" #include "mozilla/Sprintf.h"
#include "mozilla/StaticPrefs.h" #include "mozilla/StaticPrefs.h"
@ -4179,6 +4180,7 @@ void PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush aFlush) {
AutoProfilerStyleMarker tracingStyleFlush(std::move(mStyleCause), AutoProfilerStyleMarker tracingStyleFlush(std::move(mStyleCause),
docShellId, docShellHistoryId); docShellId, docShellHistoryId);
#endif #endif
PerfStats::AutoMetricRecording<PerfStats::Metric::Styling> autoRecording;
mPresContext->RestyleManager()->ProcessPendingRestyles(); mPresContext->RestyleManager()->ProcessPendingRestyles();
} }
@ -4205,6 +4207,7 @@ void PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush aFlush) {
AutoProfilerStyleMarker tracingStyleFlush(std::move(mStyleCause), AutoProfilerStyleMarker tracingStyleFlush(std::move(mStyleCause),
docShellId, docShellHistoryId); docShellId, docShellHistoryId);
#endif #endif
PerfStats::AutoMetricRecording<PerfStats::Metric::Styling> autoRecording;
mPresContext->RestyleManager()->ProcessPendingRestyles(); mPresContext->RestyleManager()->ProcessPendingRestyles();
// Clear mNeedStyleFlush here agagin to make this flag work properly for // Clear mNeedStyleFlush here agagin to make this flag work properly for
@ -9153,6 +9156,7 @@ bool PresShell::DoReflow(nsIFrame* target, bool aInterruptible,
"Reflow", LAYOUT_Reflow, "Reflow", LAYOUT_Reflow,
uri ? uri->GetSpecOrDefault() : NS_LITERAL_CSTRING("N/A")); uri ? uri->GetSpecOrDefault() : NS_LITERAL_CSTRING("N/A"));
#endif #endif
PerfStats::AutoMetricRecording<PerfStats::Metric::Reflowing> autoRecording;
gfxTextPerfMetrics* tp = mPresContext->GetTextPerfMetrics(); gfxTextPerfMetrics* tp = mPresContext->GetTextPerfMetrics();
TimeStamp timeStart; TimeStamp timeStart;

Просмотреть файл

@ -21,6 +21,7 @@
#include "mozilla/Likely.h" #include "mozilla/Likely.h"
#include "mozilla/Maybe.h" #include "mozilla/Maybe.h"
#include "mozilla/MemoryReporting.h" #include "mozilla/MemoryReporting.h"
#include "mozilla/PerfStats.h"
#include "mozilla/PresShell.h" #include "mozilla/PresShell.h"
#include "mozilla/ServoStyleSetInlines.h" #include "mozilla/ServoStyleSetInlines.h"
#include "mozilla/StaticPrefs.h" #include "mozilla/StaticPrefs.h"
@ -3875,6 +3876,8 @@ nsresult nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext,
{ {
AUTO_PROFILER_LABEL_CATEGORY_PAIR(GRAPHICS_DisplayListBuilding); AUTO_PROFILER_LABEL_CATEGORY_PAIR(GRAPHICS_DisplayListBuilding);
AUTO_PROFILER_TRACING("Paint", "DisplayList", GRAPHICS); AUTO_PROFILER_TRACING("Paint", "DisplayList", GRAPHICS);
PerfStats::AutoMetricRecording<PerfStats::Metric::DisplayListBuilding>
autoRecording;
PaintTelemetry::AutoRecord record(PaintTelemetry::Metric::DisplayList); PaintTelemetry::AutoRecord record(PaintTelemetry::Metric::DisplayList);
{ {

Просмотреть файл

@ -54,6 +54,7 @@
#include "mozilla/layers/TextureClient.h" #include "mozilla/layers/TextureClient.h"
#include "mozilla/layers/TextureWrapperImage.h" #include "mozilla/layers/TextureWrapperImage.h"
#include "mozilla/layers/WebRenderUserData.h" #include "mozilla/layers/WebRenderUserData.h"
#include "mozilla/PerfStats.h"
#include "mozilla/Unused.h" #include "mozilla/Unused.h"
#include "GeckoProfiler.h" #include "GeckoProfiler.h"
#include "LayersLogging.h" #include "LayersLogging.h"
@ -4475,6 +4476,8 @@ static void ProcessDisplayItemMarker(DisplayItemEntryType aMarker,
void ContainerState::ProcessDisplayItems(nsDisplayList* aList) { void ContainerState::ProcessDisplayItems(nsDisplayList* aList) {
AUTO_PROFILER_LABEL("ContainerState::ProcessDisplayItems", AUTO_PROFILER_LABEL("ContainerState::ProcessDisplayItems",
GRAPHICS_LayerBuilding); GRAPHICS_LayerBuilding);
PerfStats::AutoMetricRecording<PerfStats::Metric::LayerBuilding>
autoRecording;
nsPoint topLeft(0, 0); nsPoint topLeft(0, 0);