Changeset 217737 in webkit
- Timestamp:
- Jun 2, 2017 4:06:13 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 31 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r217639 r217737 2086 2086 page/PerformanceEntry.cpp 2087 2087 page/PerformanceLogging.cpp 2088 page/PerformanceLoggingClient.cpp 2088 2089 page/PerformanceMonitor.cpp 2089 2090 page/PerformanceNavigation.cpp -
trunk/Source/WebCore/ChangeLog
r217734 r217737 1 2017-06-02 Simon Fraser <simon.fraser@apple.com> 2 3 All scroll peformance logging should happen in the UI process 4 https://bugs.webkit.org/show_bug.cgi?id=172874 5 rdar://problem/24474830 6 7 Reviewed by Tim Horton. 8 9 Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds, 10 so we have to log from the UI process. 11 12 Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to 13 WebPageProxy, which prints them with the same format they had before. Some plumbing through 14 PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers 15 through to something that can get to Page. 16 17 * WebCore.xcodeproj/project.pbxproj: 18 * page/Page.cpp: 19 (WebCore::Page::Page): 20 (WebCore::Page::~Page): 21 * page/Page.h: 22 (WebCore::Page::performanceLoggingClient): 23 * page/PageConfiguration.cpp: 24 * page/PageConfiguration.h: 25 * page/PerformanceLoggingClient.cpp: Added. 26 (WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString): 27 * page/PerformanceLoggingClient.h: Added. 28 (WebCore::PerformanceLoggingClient::~PerformanceLoggingClient): 29 * page/scrolling/AsyncScrollingCoordinator.cpp: 30 (WebCore::AsyncScrollingCoordinator::reportExposedUnfilledArea): 31 (WebCore::AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged): 32 * page/scrolling/AsyncScrollingCoordinator.h: 33 * page/scrolling/ScrollingTree.h: 34 (WebCore::ScrollingTree::reportSynchronousScrollingReasonsChanged): 35 (WebCore::ScrollingTree::reportExposedUnfilledArea): 36 * page/scrolling/ThreadedScrollingTree.cpp: 37 (WebCore::ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged): 38 (WebCore::ThreadedScrollingTree::reportExposedUnfilledArea): 39 * page/scrolling/ThreadedScrollingTree.h: 40 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: 41 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: 42 (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren): 43 (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): 44 (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea): 45 (WebCore::ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea): Deleted. 46 (WebCore::logThreadedScrollingMode): Deleted. 47 * platform/graphics/GraphicsLayerClient.h: 48 (WebCore::GraphicsLayerClient::logFilledVisibleFreshTile): 49 * platform/graphics/ca/GraphicsLayerCA.cpp: 50 (WebCore::GraphicsLayerCA::platformCALayerLogFilledVisibleFreshTile): 51 * platform/graphics/ca/GraphicsLayerCA.h: 52 * platform/graphics/ca/PlatformCALayerClient.h: 53 (WebCore::PlatformCALayerClient::platformCALayerLogFilledVisibleFreshTile): 54 * platform/graphics/ca/TileController.cpp: 55 (WebCore::TileController::logFilledVisibleFreshTile): 56 * platform/graphics/ca/TileController.h: 57 * platform/graphics/ca/TileGrid.cpp: 58 (WebCore::TileGrid::platformCALayerPaintContents): 59 * platform/graphics/ca/TileGrid.h: 60 * rendering/RenderLayerBacking.cpp: 61 (WebCore::RenderLayerBacking::logFilledVisibleFreshTile): 62 * rendering/RenderLayerBacking.h: 63 1 64 2017-06-02 Eric Carlson <eric.carlson@apple.com> 2 65 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r217639 r217737 487 487 0F7D07331884C56C00B4AF86 /* PlatformTextTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 072847E216EBC5B00043CFA4 /* PlatformTextTrack.h */; settings = {ATTRIBUTES = (Private, ); }; }; 488 488 0F7DF1481E2BF1B10095951B /* WebCoreJSClientData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F7DF1471E2BF1A60095951B /* WebCoreJSClientData.cpp */; }; 489 0F850FE31ED7C18300FB77A7 /* PerformanceLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F850FE21ED7C18300FB77A7 /* PerformanceLoggingClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 489 490 0F87166F1C869D83004FF0DE /* LengthPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F87166D1C869D83004FF0DE /* LengthPoint.cpp */; }; 490 491 0F8716701C869D83004FF0DE /* LengthPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F87166E1C869D83004FF0DE /* LengthPoint.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 557 558 0FEF20CE1BD4A24100128E5D /* LengthSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEF20CD1BD4A24100128E5D /* LengthSize.cpp */; }; 558 559 0FEF20D01BD4A64F00128E5D /* RenderStyleConstants.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FEF20CF1BD4A64F00128E5D /* RenderStyleConstants.cpp */; }; 560 0FF2E80D1EE0D430009EABD4 /* PerformanceLoggingClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF2E80C1EE0D430009EABD4 /* PerformanceLoggingClient.cpp */; }; 559 561 0FF50269102BA9430066F39A /* JSStyleMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF50267102BA9430066F39A /* JSStyleMedia.cpp */; }; 560 562 0FF5026A102BA9430066F39A /* JSStyleMedia.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FF50268102BA9430066F39A /* JSStyleMedia.h */; }; … … 7918 7920 0F6A12BC1A00923700C6DE72 /* DebugPageOverlays.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugPageOverlays.h; sourceTree = "<group>"; }; 7919 7921 0F7DF1471E2BF1A60095951B /* WebCoreJSClientData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreJSClientData.cpp; sourceTree = "<group>"; }; 7922 0F850FE21ED7C18300FB77A7 /* PerformanceLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceLoggingClient.h; sourceTree = "<group>"; }; 7920 7923 0F87166D1C869D83004FF0DE /* LengthPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthPoint.cpp; sourceTree = "<group>"; }; 7921 7924 0F87166E1C869D83004FF0DE /* LengthPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LengthPoint.h; sourceTree = "<group>"; }; … … 7991 7994 0FEF20CD1BD4A24100128E5D /* LengthSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LengthSize.cpp; sourceTree = "<group>"; }; 7992 7995 0FEF20CF1BD4A64F00128E5D /* RenderStyleConstants.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderStyleConstants.cpp; sourceTree = "<group>"; }; 7996 0FF2E80C1EE0D430009EABD4 /* PerformanceLoggingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceLoggingClient.cpp; sourceTree = "<group>"; }; 7993 7997 0FF50267102BA9430066F39A /* JSStyleMedia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStyleMedia.cpp; sourceTree = "<group>"; }; 7994 7998 0FF50268102BA9430066F39A /* JSStyleMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStyleMedia.h; sourceTree = "<group>"; }; … … 19349 19353 37C738E81EDBD2ED003F2B0B /* PerformanceMark.h */, 19350 19354 37C738EA1EDBD381003F2B0B /* PerformanceMeasure.h */, 19355 0F850FE21ED7C18300FB77A7 /* PerformanceLoggingClient.h */, 19356 0FF2E80C1EE0D430009EABD4 /* PerformanceLoggingClient.cpp */, 19351 19357 83FE90251E307C1C003E9199 /* PerformanceMonitor.cpp */, 19352 19358 83FE90261E307C1C003E9199 /* PerformanceMonitor.h */, … … 29974 29980 A863E2011343412000274926 /* UnicodeBidi.h in Headers */, 29975 29981 518864E11BBAF57400E540C9 /* UniqueIDBDatabase.h in Headers */, 29982 0F850FE31ED7C18300FB77A7 /* PerformanceLoggingClient.h in Headers */, 29976 29983 5198F7A51BBDB79300E2CC5F /* UniqueIDBDatabaseConnection.h in Headers */, 29977 29984 5198F7A91BBDD38500E2CC5F /* UniqueIDBDatabaseTransaction.h in Headers */, … … 33209 33216 8A413AE11207BBA50082016E /* ScriptRunner.cpp in Sources */, 33210 33217 4127D5370F8AAB1D00E424F5 /* ScriptState.cpp in Sources */, 33218 0FF2E80D1EE0D430009EABD4 /* PerformanceLoggingClient.cpp in Sources */, 33211 33219 BC8AE34E12EA096A00EB3AE6 /* ScrollableArea.cpp in Sources */, 33212 33220 5D925B670F64D4DD00B847F0 /* ScrollAlignment.cpp in Sources */, -
trunk/Source/WebCore/page/Page.cpp
r217576 r217737 71 71 #include "PageGroup.h" 72 72 #include "PageOverlayController.h" 73 #include "PerformanceLoggingClient.h" 73 74 #include "PerformanceMonitor.h" 74 75 #include "PlatformMediaSessionManager.h" … … 211 212 , m_validationMessageClient(WTFMove(pageConfiguration.validationMessageClient)) 212 213 , m_diagnosticLoggingClient(WTFMove(pageConfiguration.diagnosticLoggingClient)) 214 , m_performanceLoggingClient(WTFMove(pageConfiguration.performanceLoggingClient)) 213 215 , m_webGLStateTracker(WTFMove(pageConfiguration.webGLStateTracker)) 214 216 , m_libWebRTCProvider(WTFMove(pageConfiguration.libWebRTCProvider)) … … 308 310 m_validationMessageClient = nullptr; 309 311 m_diagnosticLoggingClient = nullptr; 312 m_performanceLoggingClient = nullptr; 310 313 m_mainFrame->setView(nullptr); 311 314 setGroupName(String()); -
trunk/Source/WebCore/page/Page.h
r217576 r217737 110 110 class PageDebuggable; 111 111 class PageGroup; 112 class PerformanceLoggingClient; 112 113 class PerformanceMonitor; 113 114 class PlugInClient; … … 371 372 WEBCORE_EXPORT DiagnosticLoggingClient& diagnosticLoggingClient() const; 372 373 374 PerformanceLoggingClient* performanceLoggingClient() const { return m_performanceLoggingClient.get(); } 375 373 376 // Notifications when the Page starts and stops being presented via a native window. 374 377 WEBCORE_EXPORT void setActivityState(ActivityState::Flags); … … 670 673 std::unique_ptr<ValidationMessageClient> m_validationMessageClient; 671 674 std::unique_ptr<DiagnosticLoggingClient> m_diagnosticLoggingClient; 675 std::unique_ptr<PerformanceLoggingClient> m_performanceLoggingClient; 676 672 677 std::unique_ptr<WebGLStateTracker> m_webGLStateTracker; 673 678 -
trunk/Source/WebCore/page/PageConfiguration.cpp
r211161 r217737 33 33 #include "EditorClient.h" 34 34 #include "LibWebRTCProvider.h" 35 #include "PerformanceLoggingClient.h" 35 36 #include "PluginInfoProvider.h" 36 37 #include "SocketProvider.h" -
trunk/Source/WebCore/page/PageConfiguration.h
r211161 r217737 45 45 class LibWebRTCProvider; 46 46 class PaymentCoordinatorClient; 47 class PerformanceLoggingClient; 47 48 class PlugInClient; 48 49 class PluginInfoProvider; … … 82 83 FrameLoaderClient* loaderClientForMainFrame { nullptr }; 83 84 std::unique_ptr<DiagnosticLoggingClient> diagnosticLoggingClient; 85 std::unique_ptr<PerformanceLoggingClient> performanceLoggingClient; 84 86 std::unique_ptr<WebGLStateTracker> webGLStateTracker; 85 87 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r216592 r217737 38 38 #include "MainFrame.h" 39 39 #include "Page.h" 40 #include "PerformanceLoggingClient.h" 40 41 #include "ScrollAnimator.h" 41 42 #include "ScrollingConstraints.h" … … 695 696 } 696 697 #endif 697 698 699 void AsyncScrollingCoordinator::reportExposedUnfilledArea(MonotonicTime timestamp, unsigned unfilledArea) 700 { 701 if (m_page && m_page->performanceLoggingClient()) 702 m_page->performanceLoggingClient()->logScrollingEvent(PerformanceLoggingClient::ScrollingEvent::ExposedTilelessArea, timestamp, unfilledArea); 703 } 704 705 void AsyncScrollingCoordinator::reportSynchronousScrollingReasonsChanged(MonotonicTime timestamp, SynchronousScrollingReasons reasons) 706 { 707 if (m_page && m_page->performanceLoggingClient()) 708 m_page->performanceLoggingClient()->logScrollingEvent(PerformanceLoggingClient::ScrollingEvent::SwitchedScrollingMode, timestamp, reasons); 709 } 710 698 711 } // namespace WebCore 699 712 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
r216592 r217737 65 65 66 66 WEBCORE_EXPORT void updateExpectsWheelEventTestTriggerWithFrameView(const FrameView&) override; 67 68 void reportExposedUnfilledArea(MonotonicTime, unsigned unfilledArea); 69 void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons); 67 70 68 71 protected: -
trunk/Source/WebCore/page/scrolling/ScrollingTree.h
r211033 r217737 94 94 WEBCORE_EXPORT virtual void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) = 0; 95 95 96 WEBCORE_EXPORT virtual void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons) { } 97 WEBCORE_EXPORT virtual void reportExposedUnfilledArea(MonotonicTime, unsigned /* unfilledArea */) { } 98 96 99 FloatPoint mainFrameScrollPosition(); 97 100 -
trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
r211033 r217737 106 106 } 107 107 108 void ThreadedScrollingTree::reportSynchronousScrollingReasonsChanged(MonotonicTime timestamp, SynchronousScrollingReasons reasons) 109 { 110 RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, timestamp, reasons] { 111 scrollingCoordinator->reportSynchronousScrollingReasonsChanged(timestamp, reasons); 112 }); 113 } 114 115 void ThreadedScrollingTree::reportExposedUnfilledArea(MonotonicTime timestamp, unsigned unfilledArea) 116 { 117 RunLoop::main().dispatch([scrollingCoordinator = m_scrollingCoordinator, timestamp, unfilledArea] { 118 scrollingCoordinator->reportExposedUnfilledArea(timestamp, unfilledArea); 119 }); 120 } 121 108 122 void ThreadedScrollingTree::currentSnapPointIndicesDidChange(ScrollingNodeID nodeID, unsigned horizontal, unsigned vertical) 109 123 { -
trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h
r211033 r217737 67 67 #endif 68 68 69 void reportExposedUnfilledArea(MonotonicTime, unsigned unfilledArea) override; 70 void reportSynchronousScrollingReasonsChanged(MonotonicTime, SynchronousScrollingReasons) override; 71 69 72 private: 70 73 bool isThreadedScrollingTree() const override { return true; } -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h
r209070 r217737 94 94 #endif 95 95 96 void logExposedUnfilledArea();96 unsigned exposedUnfilledArea() const; 97 97 98 98 ScrollController m_scrollController; -
trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
r210828 r217737 45 45 #import <wtf/CurrentTime.h> 46 46 #import <wtf/Deque.h> 47 #import <wtf/text/StringBuilder.h>48 47 #import <wtf/text/CString.h> 49 48 50 49 namespace WebCore { 51 52 static void logThreadedScrollingMode(unsigned synchronousScrollingReasons);53 50 54 51 Ref<ScrollingTreeFrameScrollingNode> ScrollingTreeFrameScrollingNodeMac::create(ScrollingTree& scrollingTree, ScrollingNodeID nodeID) … … 150 147 } 151 148 152 if (logScrollingMode) { 153 if (scrollingTree().scrollingPerformanceLoggingEnabled()) 154 logThreadedScrollingMode(synchronousScrollingReasons()); 155 } 149 if (logScrollingMode && scrollingTree().scrollingPerformanceLoggingEnabled()) 150 scrollingTree().reportSynchronousScrollingReasonsChanged(MonotonicTime::now(), synchronousScrollingReasons()); 156 151 157 152 #if ENABLE(CSS_SCROLL_SNAP) … … 390 385 ScrollingTreeFrameScrollingNode::setScrollPosition(roundedPosition); 391 386 392 if (scrollingTree().scrollingPerformanceLoggingEnabled()) 393 logExposedUnfilledArea(); 387 if (scrollingTree().scrollingPerformanceLoggingEnabled()) { 388 unsigned unfilledArea = exposedUnfilledArea(); 389 if (unfilledArea || m_lastScrollHadUnfilledPixels) 390 scrollingTree().reportExposedUnfilledArea(MonotonicTime::now(), unfilledArea); 391 392 m_lastScrollHadUnfilledPixels = unfilledArea; 393 } 394 394 } 395 395 … … 530 530 } 531 531 532 void ScrollingTreeFrameScrollingNodeMac::logExposedUnfilledArea() 532 unsigned ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea() const 533 533 { 534 534 Region paintedVisibleTiles; … … 556 556 FloatPoint scrollPosition = this->scrollPosition(); 557 557 FloatRect viewPortRect(FloatPoint(), scrollableAreaSize()); 558 unsigned unfilledArea = TileController::blankPixelCountForTiles(tiles, viewPortRect, IntPoint(-scrollPosition.x(), -scrollPosition.y())); 559 560 if (unfilledArea || m_lastScrollHadUnfilledPixels) 561 WTFLogAlways("SCROLLING: Exposed tileless area. Time: %f Unfilled Pixels: %u\n", WTF::monotonicallyIncreasingTime(), unfilledArea); 562 563 m_lastScrollHadUnfilledPixels = unfilledArea; 564 } 565 566 static void logThreadedScrollingMode(unsigned synchronousScrollingReasons) 567 { 568 if (synchronousScrollingReasons) { 569 StringBuilder reasonsDescription; 570 571 if (synchronousScrollingReasons & ScrollingCoordinator::ForcedOnMainThread) 572 reasonsDescription.appendLiteral("forced,"); 573 if (synchronousScrollingReasons & ScrollingCoordinator::HasSlowRepaintObjects) 574 reasonsDescription.appendLiteral("slow-repaint objects,"); 575 if (synchronousScrollingReasons & ScrollingCoordinator::HasViewportConstrainedObjectsWithoutSupportingFixedLayers) 576 reasonsDescription.appendLiteral("viewport-constrained objects,"); 577 if (synchronousScrollingReasons & ScrollingCoordinator::HasNonLayerViewportConstrainedObjects) 578 reasonsDescription.appendLiteral("non-layer viewport-constrained objects,"); 579 if (synchronousScrollingReasons & ScrollingCoordinator::IsImageDocument) 580 reasonsDescription.appendLiteral("image document,"); 581 582 // Strip the trailing comma. 583 String reasonsDescriptionTrimmed = reasonsDescription.toString().left(reasonsDescription.length() - 1); 584 585 WTFLogAlways("SCROLLING: Switching to main-thread scrolling mode. Time: %f Reason(s): %s\n", WTF::monotonicallyIncreasingTime(), reasonsDescriptionTrimmed.ascii().data()); 586 } else 587 WTFLogAlways("SCROLLING: Switching to threaded scrolling mode. Time: %f\n", WTF::monotonicallyIncreasingTime()); 558 return TileController::blankPixelCountForTiles(tiles, viewPortRect, IntPoint(-scrollPosition.x(), -scrollPosition.y())); 588 559 } 589 560 -
trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h
r217696 r217737 130 130 virtual bool needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack(const GraphicsLayer&) const { return false; } 131 131 132 virtual void logFilledVisibleFreshTile(unsigned) { }; 133 132 134 #ifndef NDEBUG 133 135 // RenderLayerBacking overrides this to verify that it is not -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r217696 r217737 1621 1621 } 1622 1622 1623 void GraphicsLayerCA::platformCALayerLogFilledVisibleFreshTile(unsigned blankPixelCount) 1624 { 1625 client().logFilledVisibleFreshTile(blankPixelCount); 1626 } 1627 1623 1628 static PlatformCALayer::LayerType layerTypeForCustomBackdropAppearance(GraphicsLayer::CustomAppearance appearance) 1624 1629 { -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r217696 r217737 202 202 WEBCORE_EXPORT bool platformCALayerShouldTemporarilyRetainTileCohorts(PlatformCALayer*) const override; 203 203 WEBCORE_EXPORT bool platformCALayerUseGiantTiles() const override; 204 WEBCORE_EXPORT void platformCALayerLogFilledVisibleFreshTile(unsigned) override; 204 205 205 206 bool isCommittingChanges() const override { return m_isCommittingChanges; } -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h
r217296 r217737 66 66 virtual bool isUsingDisplayListDrawing(PlatformCALayer*) const { return false; } 67 67 68 virtual void platformCALayerLogFilledVisibleFreshTile(unsigned /* blankPixelCount */) { } 69 68 70 protected: 69 71 virtual ~PlatformCALayerClient() {} -
trunk/Source/WebCore/platform/graphics/ca/TileController.cpp
r215152 r217737 778 778 #endif 779 779 780 void TileController::logFilledVisibleFreshTile(unsigned blankPixelCount) 781 { 782 owningGraphicsLayer()->platformCALayerLogFilledVisibleFreshTile(blankPixelCount); 783 } 784 780 785 } // namespace WebCore 781 786 -
trunk/Source/WebCore/platform/graphics/ca/TileController.h
r215143 r217737 24 24 */ 25 25 26 #ifndef TileController_h 27 #define TileController_h 26 #pragma once 28 27 29 28 #include "FloatRect.h" … … 139 138 140 139 WEBCORE_EXPORT Vector<RefPtr<PlatformCALayer>> containerLayers(); 140 141 void logFilledVisibleFreshTile(unsigned blankPixelCount); 141 142 142 143 private: … … 213 214 int m_marginSize { kDefaultTileSize }; 214 215 216 Scrollability m_scrollability { HorizontallyScrollable | VerticallyScrollable }; 217 215 218 // m_marginTop and m_marginBottom are the height in pixels of the top and bottom margin tiles. The width 216 219 // of those tiles will be equivalent to the width of the other tiles in the grid. m_marginRight and 217 220 // m_marginLeft are the width in pixels of the right and left margin tiles, respectively. The height of 218 221 // those tiles will be equivalent to the height of the other tiles in the grid. 219 220 Scrollability m_scrollability { HorizontallyScrollable | VerticallyScrollable };221 222 222 BoxExtent<bool> m_marginEdges; 223 223 … … 241 241 } // namespace WebCore 242 242 243 #endif // TileController_h -
trunk/Source/WebCore/platform/graphics/ca/TileGrid.cpp
r217296 r217737 740 740 741 741 if (repaintCount == 1 && !visiblePart.isEmpty()) 742 WTFLogAlways("SCROLLING: Filled visible fresh tile. Time: %f Unfilled Pixels: %u\n", WTF::monotonicallyIncreasingTime(),blankPixelCount());742 m_controller.logFilledVisibleFreshTile(blankPixelCount()); 743 743 } 744 744 } -
trunk/Source/WebCore/platform/graphics/ca/TileGrid.h
r217296 r217737 24 24 */ 25 25 26 #ifndef TileGrid_h 27 #define TileGrid_h 26 #pragma once 28 27 29 28 #include "IntPointHash.h" … … 179 178 180 179 } 181 #endif 180 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r217696 r217737 48 48 #include "MainFrame.h" 49 49 #include "Page.h" 50 #include "PerformanceLoggingClient.h" 50 51 #include "PluginViewBase.h" 51 52 #include "ProgressTracker.h" … … 2696 2697 } 2697 2698 2699 void RenderLayerBacking::logFilledVisibleFreshTile(unsigned blankPixelCount) 2700 { 2701 if (PerformanceLoggingClient* loggingClient = renderer().page().performanceLoggingClient()) 2702 loggingClient->logScrollingEvent(PerformanceLoggingClient::ScrollingEvent::FilledTile, MonotonicTime::now(), blankPixelCount); 2703 } 2704 2698 2705 #ifndef NDEBUG 2699 2706 void RenderLayerBacking::verifyNotPainting() -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r217296 r217737 217 217 bool shouldTemporarilyRetainTileCohorts(const GraphicsLayer*) const override; 218 218 bool useGiantTiles() const override; 219 void logFilledVisibleFreshTile(unsigned) override; 219 220 bool needsPixelAligment() const override { return !m_isMainFrameRenderViewLayer; } 220 221 -
trunk/Source/WebKit2/CMakeLists.txt
r216809 r217737 555 555 WebProcess/WebCoreSupport/WebInspectorClient.cpp 556 556 WebProcess/WebCoreSupport/WebNotificationClient.cpp 557 WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp 557 558 WebProcess/WebCoreSupport/WebPlatformStrategies.cpp 558 559 WebProcess/WebCoreSupport/WebPlugInClient.cpp -
trunk/Source/WebKit2/ChangeLog
r217729 r217737 1 2017-06-02 Simon Fraser <simon.fraser@apple.com> 2 3 All scroll peformance logging should happen in the UI process 4 https://bugs.webkit.org/show_bug.cgi?id=172874 5 rdar://problem/24474830 6 7 Reviewed by Tim Horton. 8 9 Printing to stdout from the WebProcess doesn't show up anywhere in non-development builds, 10 so we have to log from the UI process. 11 12 Achieve this by adding a PerformanceLoggingClient to Page which forwards messages to 13 WebPageProxy, which prints them with the same format they had before. Some plumbing through 14 PlatformCALayerClient and GraphicsLayerClient is required to get messages from TileControllers 15 through to something that can get to Page. 16 17 * UIProcess/WebPageProxy.cpp: 18 (WebKit::WebPageProxy::logScrollingEvent): 19 * UIProcess/WebPageProxy.h: 20 * UIProcess/WebPageProxy.messages.in: 21 * WebKit2.xcodeproj/project.pbxproj: 22 * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp: Added. 23 (WebKit::WebPerformanceLoggingClient::WebPerformanceLoggingClient): 24 (WebKit::WebPerformanceLoggingClient::logScrollingEvent): 25 * WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h: Added. 26 * WebProcess/WebPage/WebPage.cpp: 27 (WebKit::m_cpuLimit): 28 1 29 2017-06-02 Chris Dumez <cdumez@apple.com> 2 30 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r217725 r217737 125 125 #include <WebCore/LengthBox.h> 126 126 #include <WebCore/MIMETypeRegistry.h> 127 #include <WebCore/PerformanceLoggingClient.h> 127 128 #include <WebCore/PublicSuffix.h> 128 129 #include <WebCore/RenderEmbeddedObject.h> … … 5210 5211 5211 5212 m_diagnosticLoggingClient->logDiagnosticMessageWithEnhancedPrivacy(this, message, description); 5213 } 5214 5215 void WebPageProxy::logScrollingEvent(uint32_t eventType, MonotonicTime timestamp, uint64_t data) 5216 { 5217 PerformanceLoggingClient::ScrollingEvent event = static_cast<PerformanceLoggingClient::ScrollingEvent>(eventType); 5218 5219 switch (event) { 5220 case PerformanceLoggingClient::ScrollingEvent::ExposedTilelessArea: 5221 WTFLogAlways("SCROLLING: Exposed tileless area. Time: %f Unfilled Pixels: %llu\n", timestamp.secondsSinceEpoch().value(), (unsigned long long)data); 5222 break; 5223 case PerformanceLoggingClient::ScrollingEvent::FilledTile: 5224 WTFLogAlways("SCROLLING: Filled visible fresh tile. Time: %f Unfilled Pixels: %llu\n", timestamp.secondsSinceEpoch().value(), (unsigned long long)data); 5225 break; 5226 case PerformanceLoggingClient::ScrollingEvent::SwitchedScrollingMode: 5227 if (data) 5228 WTFLogAlways("SCROLLING: Switching to main-thread scrolling mode. Time: %f Reason(s): %s\n", timestamp.secondsSinceEpoch().value(), PerformanceLoggingClient::synchronousScrollingReasonsAsString(data).utf8().data()); 5229 else 5230 WTFLogAlways("SCROLLING: Switching to threaded scrolling mode. Time: %f\n", timestamp.secondsSinceEpoch().value()); 5231 break; 5232 } 5212 5233 } 5213 5234 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r217725 r217737 83 83 #include <wtf/HashMap.h> 84 84 #include <wtf/HashSet.h> 85 #include <wtf/MonotonicTime.h> 85 86 #include <wtf/Ref.h> 86 87 #include <wtf/RefPtr.h> … … 1109 1110 void logDiagnosticMessageWithEnhancedPrivacy(const String& message, const String& description, WebCore::ShouldSample); 1110 1111 1112 // Performance logging. 1113 void logScrollingEvent(uint32_t eventType, MonotonicTime, uint64_t); 1114 1111 1115 // Form validation messages. 1112 1116 void showValidationMessage(const WebCore::IntRect& anchorClientRect, const String& message); -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r217571 r217737 231 231 LogDiagnosticMessageWithEnhancedPrivacy(String message, String description, enum WebCore::ShouldSample shouldSample) 232 232 233 # Performance logging 234 LogScrollingEvent(uint32_t eventType, MonotonicTime timestamp, uint64_t data) 235 233 236 # Editor notifications 234 237 EditorStateChanged(struct WebKit::EditorState editorState) -
trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
r217137 r217737 87 87 0F5E200318E77051003EC3E5 /* PlatformCAAnimationRemote.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F5E200118E77051003EC3E5 /* PlatformCAAnimationRemote.mm */; }; 88 88 0F5E200418E77051003EC3E5 /* PlatformCAAnimationRemote.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5E200218E77051003EC3E5 /* PlatformCAAnimationRemote.h */; }; 89 0F850FE61ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F850FE41ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp */; }; 90 0F850FE71ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F850FE51ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h */; }; 89 91 0F931C1C18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */; }; 90 92 0F931C1D18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */; }; … … 2241 2243 0F707C771A1FEE8300DA7A45 /* RemoteLayerTreeScrollingPerformanceData.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerTreeScrollingPerformanceData.mm; sourceTree = "<group>"; }; 2242 2244 0F707C791A1FEEA300DA7A45 /* RemoteLayerTreeScrollingPerformanceData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreeScrollingPerformanceData.h; sourceTree = "<group>"; }; 2245 0F850FE41ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPerformanceLoggingClient.cpp; sourceTree = "<group>"; }; 2246 0F850FE51ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPerformanceLoggingClient.h; sourceTree = "<group>"; }; 2243 2247 0F931C1A18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScrollingTreeOverflowScrollingNodeIOS.h; path = Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h; sourceTree = "<group>"; }; 2244 2248 0F931C1B18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollingTreeOverflowScrollingNodeIOS.mm; path = Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm; sourceTree = "<group>"; }; … … 6593 6597 512127C11908239A00DAF35C /* WebPasteboardOverrides.cpp */, 6594 6598 512127C21908239A00DAF35C /* WebPasteboardOverrides.h */, 6599 0F850FE41ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp */, 6600 0F850FE51ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h */, 6595 6601 1A3E736011CC2659007BD539 /* WebPlatformStrategies.cpp */, 6596 6602 1A3E735F11CC2659007BD539 /* WebPlatformStrategies.h */, … … 8604 8610 CEDA12E3152CD1B300D9E08D /* WebAlternativeTextClient.h in Headers */, 8605 8611 9955A6EC1C7980C200EB6A93 /* WebAutomationSession.h in Headers */, 8612 0F850FE71ED7C39F00FB77A7 /* WebPerformanceLoggingClient.h in Headers */, 8606 8613 99C3AE2D1DADA6AD00AF5C16 /* WebAutomationSessionMacros.h in Headers */, 8607 8614 1C0A19581C90068F00FE0EBB /* WebAutomationSessionMessages.h in Headers */, … … 10289 10296 51FB08FF1639DE1A00EC324A /* WebLoaderStrategy.cpp in Sources */, 10290 10297 CD003A5219D49B5D005ABCE0 /* WebMediaKeyStorageManager.cpp in Sources */, 10298 0F850FE61ED7C39F00FB77A7 /* WebPerformanceLoggingClient.cpp in Sources */, 10291 10299 C98C48A51B6FD4C300145103 /* WebMediaSessionFocusManager.cpp in Sources */, 10292 10300 C9C1833B1B74026A007036A7 /* WebMediaSessionFocusManagerClient.cpp in Sources */, -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.cpp
r217736 r217737 1 1 /* 2 * Copyright (C) 201 4Apple Inc. All rights reserved.2 * Copyright (C) 2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 26 26 #include "config.h" 27 #include " PageConfiguration.h"27 #include "WebPerformanceLoggingClient.h" 28 28 29 #include "ApplicationCacheStorage.h" 30 #include "BackForwardClient.h" 31 #include "DatabaseProvider.h" 32 #include "DiagnosticLoggingClient.h" 33 #include "EditorClient.h" 34 #include "LibWebRTCProvider.h" 35 #include "PluginInfoProvider.h" 36 #include "SocketProvider.h" 37 #include "StorageNamespaceProvider.h" 38 #include "UserContentController.h" 39 #include "ValidationMessageClient.h" 40 #include "VisitedLinkStore.h" 41 #include "WebGLStateTracker.h" 29 #include "WebCoreArgumentCoders.h" 30 #include "WebPage.h" 31 #include "WebPageProxyMessages.h" 42 32 43 namespace Web Core{33 namespace WebKit { 44 34 45 PageConfiguration::PageConfiguration(UniqueRef<EditorClient>&& editorClient, Ref<SocketProvider>&& socketProvider, UniqueRef<LibWebRTCProvider>&& libWebRTCProvider) 46 : editorClient(WTFMove(editorClient)) 47 , socketProvider(WTFMove(socketProvider))48 , libWebRTCProvider(WTFMove(libWebRTCProvider))35 using namespace WebCore; 36 37 WebPerformanceLoggingClient::WebPerformanceLoggingClient(WebPage& page) 38 : m_page(page) 49 39 { 50 40 } 51 41 52 PageConfiguration::~PageConfiguration()42 void WebPerformanceLoggingClient::logScrollingEvent(ScrollingEvent event, MonotonicTime timestamp, uint64_t data) 53 43 { 44 m_page.send(Messages::WebPageProxy::LogScrollingEvent(static_cast<uint32_t>(event), timestamp, data)); 54 45 } 55 46 56 } 47 } // namespace WebKit -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPerformanceLoggingClient.h
r217736 r217737 1 1 /* 2 * Copyright (C) 201 4Apple Inc. All rights reserved.2 * Copyright (C) 2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 21 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 25 26 #include "config.h" 27 #include "PageConfiguration.h" 26 #pragma once 28 27 29 #include "ApplicationCacheStorage.h" 30 #include "BackForwardClient.h" 31 #include "DatabaseProvider.h" 32 #include "DiagnosticLoggingClient.h" 33 #include "EditorClient.h" 34 #include "LibWebRTCProvider.h" 35 #include "PluginInfoProvider.h" 36 #include "SocketProvider.h" 37 #include "StorageNamespaceProvider.h" 38 #include "UserContentController.h" 39 #include "ValidationMessageClient.h" 40 #include "VisitedLinkStore.h" 41 #include "WebGLStateTracker.h" 28 #include <WebCore/PerformanceLoggingClient.h> 29 #include <wtf/Forward.h> 42 30 43 namespace Web Core{31 namespace WebKit { 44 32 45 PageConfiguration::PageConfiguration(UniqueRef<EditorClient>&& editorClient, Ref<SocketProvider>&& socketProvider, UniqueRef<LibWebRTCProvider>&& libWebRTCProvider) 46 : editorClient(WTFMove(editorClient)) 47 , socketProvider(WTFMove(socketProvider)) 48 , libWebRTCProvider(WTFMove(libWebRTCProvider)) 49 { 50 } 33 class WebPage; 51 34 52 PageConfiguration::~PageConfiguration() 53 { 54 } 35 class WebPerformanceLoggingClient : public WebCore::PerformanceLoggingClient { 36 public: 37 WebPerformanceLoggingClient(WebPage&); 38 virtual ~WebPerformanceLoggingClient() = default; 39 40 private: 41 void logScrollingEvent(ScrollingEvent, MonotonicTime, uint64_t) override; 42 43 WebPage& m_page; 44 }; 55 45 56 46 } -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r217725 r217737 103 103 #include "WebPageProxyMessages.h" 104 104 #include "WebPaymentCoordinator.h" 105 #include "WebPerformanceLoggingClient.h" 105 106 #include "WebPlugInClient.h" 106 107 #include "WebPluginInfoProvider.h" … … 396 397 pageConfiguration.progressTrackerClient = new WebProgressTrackerClient(*this); 397 398 pageConfiguration.diagnosticLoggingClient = std::make_unique<WebDiagnosticLoggingClient>(*this); 399 pageConfiguration.performanceLoggingClient = std::make_unique<WebPerformanceLoggingClient>(*this); 400 398 401 pageConfiguration.webGLStateTracker = std::make_unique<WebGLStateTracker>([this](bool isUsingHighPerformanceWebGL) { 399 402 send(Messages::WebPageProxy::SetIsUsingHighPerformanceWebGL(isUsingHighPerformanceWebGL));
Note: See TracChangeset
for help on using the changeset viewer.