Title: [276360] trunk
Revision
276360
Author
simon.fra...@apple.com
Date
2021-04-21 08:00:38 -0700 (Wed, 21 Apr 2021)

Log Message

Enhance scrolling-related trace points
https://bugs.webkit.org/show_bug.cgi?id=224852

Reviewed by Tim Horton.
Source/WebCore:

Add a new trace point when the "display did refresh" ping gets to ThreadedScrollingTree on
the EventDispatcher thread, and add some metadata to the existing displayDidRefresh trace
scope.

* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread):
(WebCore::ThreadedScrollingTree::displayDidRefresh):

Source/WebKit:

Add a new trace point in EventDispatcher::displayWasRefreshed() so we can tell when the
WebProcess receives displayDidRefresh IPC (this can sometimes be delayed by other work that
might share the same dispatch thread).

We repurpose the existing DisplayRefreshDispatchingToMainThread which is the WK1 equivalent.

* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::displayWasRefreshed):

Source/WTF:

One new trace point, and some argument descriptors.

* wtf/SystemTracing.h:

Tools:

Update trace point descriptions.

* Tracing/SystemTracePoints.plist:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (276359 => 276360)


--- trunk/Source/WTF/ChangeLog	2021-04-21 14:15:12 UTC (rev 276359)
+++ trunk/Source/WTF/ChangeLog	2021-04-21 15:00:38 UTC (rev 276360)
@@ -1,3 +1,14 @@
+2021-04-21  Simon Fraser  <simon.fra...@apple.com>
+
+        Enhance scrolling-related trace points
+        https://bugs.webkit.org/show_bug.cgi?id=224852
+
+        Reviewed by Tim Horton.
+        
+        One new trace point, and some argument descriptors.
+
+        * wtf/SystemTracing.h:
+
 2021-04-20  Brent Fulgham  <bfulg...@apple.com>
 
         [Cocoa] Prevent GPU and WebContent processes from attempting to connect to the AppSSO service 

Modified: trunk/Source/WTF/wtf/SystemTracing.h (276359 => 276360)


--- trunk/Source/WTF/wtf/SystemTracing.h	2021-04-21 14:15:12 UTC (rev 276359)
+++ trunk/Source/WTF/wtf/SystemTracing.h	2021-04-21 15:00:38 UTC (rev 276360)
@@ -94,6 +94,7 @@
     ScrollingThreadRenderUpdateSyncEnd,
     ScrollingThreadDisplayDidRefreshStart,
     ScrollingThreadDisplayDidRefreshEnd,
+    ScrollingTreeDisplayDidRefresh,
 
     WebKitRange = 10000,
     WebHTMLViewPaintStart,

Modified: trunk/Source/WebCore/ChangeLog (276359 => 276360)


--- trunk/Source/WebCore/ChangeLog	2021-04-21 14:15:12 UTC (rev 276359)
+++ trunk/Source/WebCore/ChangeLog	2021-04-21 15:00:38 UTC (rev 276360)
@@ -1,3 +1,18 @@
+2021-04-21  Simon Fraser  <simon.fra...@apple.com>
+
+        Enhance scrolling-related trace points
+        https://bugs.webkit.org/show_bug.cgi?id=224852
+
+        Reviewed by Tim Horton.
+
+        Add a new trace point when the "display did refresh" ping gets to ThreadedScrollingTree on
+        the EventDispatcher thread, and add some metadata to the existing displayDidRefresh trace
+        scope.
+
+        * page/scrolling/ThreadedScrollingTree.cpp:
+        (WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread):
+        (WebCore::ThreadedScrollingTree::displayDidRefresh):
+
 2021-04-21  Youenn Fablet  <you...@apple.com>
 
         AudioMediaStreamTrackRendererUnit should not have its data zeroed if one track has not enough data

Modified: trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp (276359 => 276360)


--- trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp	2021-04-21 14:15:12 UTC (rev 276359)
+++ trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp	2021-04-21 15:00:38 UTC (rev 276360)
@@ -366,7 +366,7 @@
 
 void ThreadedScrollingTree::displayDidRefreshOnScrollingThread()
 {
-    TraceScope tracingScope(ScrollingThreadDisplayDidRefreshStart, ScrollingThreadDisplayDidRefreshEnd);
+    TraceScope tracingScope(ScrollingThreadDisplayDidRefreshStart, ScrollingThreadDisplayDidRefreshEnd, displayID());
     ASSERT(ScrollingThread::isCurrentThread());
 
     LockHolder treeLocker(m_treeMutex);
@@ -390,13 +390,16 @@
 
 void ThreadedScrollingTree::displayDidRefresh(PlatformDisplayID displayID)
 {
+    bool hasProcessedWheelEventsRecently = this->hasProcessedWheelEventsRecently();
+
     // We're on the EventDispatcher thread or in the ThreadedCompositor thread here.
+    tracePoint(ScrollingTreeDisplayDidRefresh, displayID, hasProcessedWheelEventsRecently);
 
     if (displayID != this->displayID())
         return;
 
 #if !PLATFORM(WPE) && !PLATFORM(GTK)
-    if (!hasProcessedWheelEventsRecently())
+    if (!hasProcessedWheelEventsRecently)
         return;
 #endif
 

Modified: trunk/Source/WebKit/ChangeLog (276359 => 276360)


--- trunk/Source/WebKit/ChangeLog	2021-04-21 14:15:12 UTC (rev 276359)
+++ trunk/Source/WebKit/ChangeLog	2021-04-21 15:00:38 UTC (rev 276360)
@@ -1,3 +1,19 @@
+2021-04-21  Simon Fraser  <simon.fra...@apple.com>
+
+        Enhance scrolling-related trace points
+        https://bugs.webkit.org/show_bug.cgi?id=224852
+
+        Reviewed by Tim Horton.
+
+        Add a new trace point in EventDispatcher::displayWasRefreshed() so we can tell when the
+        WebProcess receives displayDidRefresh IPC (this can sometimes be delayed by other work that
+        might share the same dispatch thread).
+
+        We repurpose the existing DisplayRefreshDispatchingToMainThread which is the WK1 equivalent.
+
+        * WebProcess/WebPage/EventDispatcher.cpp:
+        (WebKit::EventDispatcher::displayWasRefreshed):
+
 2021-04-21  Philippe Normand  <pnorm...@igalia.com>
 
         Unreviewed, WPE Cog build fix after r276316

Modified: trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp (276359 => 276360)


--- trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp	2021-04-21 14:15:12 UTC (rev 276359)
+++ trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp	2021-04-21 15:00:38 UTC (rev 276360)
@@ -291,6 +291,8 @@
 #if HAVE(CVDISPLAYLINK)
 void EventDispatcher::displayWasRefreshed(PlatformDisplayID displayID, const DisplayUpdate& displayUpdate, bool sendToMainThread)
 {
+    tracePoint(DisplayRefreshDispatchingToMainThread, displayID, sendToMainThread);
+
     ASSERT(!RunLoop::isMain());
     notifyScrollingTreesDisplayWasRefreshed(displayID);
 

Modified: trunk/Tools/ChangeLog (276359 => 276360)


--- trunk/Tools/ChangeLog	2021-04-21 14:15:12 UTC (rev 276359)
+++ trunk/Tools/ChangeLog	2021-04-21 15:00:38 UTC (rev 276360)
@@ -1,3 +1,14 @@
+2021-04-21  Simon Fraser  <simon.fra...@apple.com>
+
+        Enhance scrolling-related trace points
+        https://bugs.webkit.org/show_bug.cgi?id=224852
+
+        Reviewed by Tim Horton.
+
+        Update trace point descriptions.
+
+        * Tracing/SystemTracePoints.plist:
+
 2021-04-21  Lauro Moura  <lmo...@igalia.com>
 
         [WPE] Allow defining custom repo and branch for Cog checkout

Modified: trunk/Tools/Tracing/SystemTracePoints.plist (276359 => 276360)


--- trunk/Tools/Tracing/SystemTracePoints.plist	2021-04-21 14:15:12 UTC (rev 276359)
+++ trunk/Tools/Tracing/SystemTracePoints.plist	2021-04-21 15:00:38 UTC (rev 276360)
@@ -215,6 +215,13 @@
                  <string>47</string>
                  <key>Code</key>
                  <string>5025</string>
+                 <key>ArgNames</key>
+                 <dict>
+                     <key>Arg1</key>
+                     <string>Display ID</string>
+                     <key>Arg2</key>
+                     <string>Send to main thread</string>
+                 </dict>
              </dict>
              <dict>
                  <key>Name</key>
@@ -360,9 +367,31 @@
                  <string>5042</string>
                  <key>CodeEnd</key>
                  <string>5043</string>
+                 <key>ArgNamesBegin</key>
+                 <dict>
+                     <key>Arg1</key>
+                     <string>Display ID</string>
+                 </dict>
              </dict>
              <dict>
                  <key>Name</key>
+                 <string>Display Refresh Dispatch to scrolling thread</string>
+                 <key>Type</key>
+                 <string>Impulse</string>
+                 <key>Component</key>
+                 <string>47</string>
+                 <key>Code</key>
+                 <string>5044</string>
+                 <key>ArgNames</key>
+                 <dict>
+                     <key>Arg1</key>
+                     <string>Display ID</string>
+                     <key>Arg2</key>
+                     <string>Recent Events?</string>
+                 </dict>
+             </dict>
+             <dict>
+                 <key>Name</key>
                  <string>Paint WebHTMLView</string>
                  <key>Type</key>
                  <string>Interval</string>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to