Improve the system tracing points
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Mar 2017 00:47:16 +0000 (00:47 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Mar 2017 00:47:16 +0000 (00:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=169790

Reviewed by Zalan Bujtas.

Use a more cohesive set of system trace points that give a good overview of what
WebKit is doing. Added points for resource loading, render tree building, sync messages
to the web process, async image decode, WASM and fetching cookies.

Source/JavaScriptCore:

* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::run):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):

Source/WebCore:

* loader/CookieJar.cpp:
(WebCore::cookies):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::provisionalLoadStarted):
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
(WebCore::logResourceLoaded):
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::didFail):
(WebCore::SubresourceLoader::didCancel):
* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::startAsyncDecodingQueue):
* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
(WebCore::DisplayRefreshMonitorIOS::requestRefreshCallback):
(WebCore::DisplayRefreshMonitorIOS::displayLinkFired):
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::commit):

Source/WebKit/mac:

* WebView/WebHTMLView.mm:
(-[WebHTMLView drawRect:]):

Source/WebKit2:

* UIProcess/ChildProcessProxy.h:
(WebKit::ChildProcessProxy::sendSync):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleTouchEventSynchronously):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::buildTransaction):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::didUpdate):
(WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):

Source/WTF:

* wtf/SystemTracing.h:

Tools:

* Tracing/SystemTracePoints.plist:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214084 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wasm/WasmPlan.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/SystemTracing.h
Source/WebCore/ChangeLog
Source/WebCore/loader/CookieJar.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/platform/graphics/ImageFrameCache.cpp
Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm
Source/WebCore/style/RenderTreeUpdater.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/ChildProcessProxy.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
Tools/ChangeLog
Tools/Tracing/SystemTracePoints.plist

index d2fef84..e86735e 100644 (file)
@@ -1,3 +1,19 @@
+2017-03-16  Simon Fraser  <simon.fraser@apple.com>
+
+        Improve the system tracing points
+        https://bugs.webkit.org/show_bug.cgi?id=169790
+
+        Reviewed by Zalan Bujtas.
+
+        Use a more cohesive set of system trace points that give a good overview of what
+        WebKit is doing. Added points for resource loading, render tree building, sync messages
+        to the web process, async image decode, WASM and fetching cookies.
+
+        * wasm/WasmPlan.cpp:
+        (JSC::Wasm::Plan::run):
+        * wasm/js/WebAssemblyFunction.cpp:
+        (JSC::callWebAssemblyFunction):
+
 2017-03-16  Mark Lam  <mark.lam@apple.com>
 
         Array concat operation should check for length overflows.
index 4835aa2..1a8d3dc 100644 (file)
@@ -44,6 +44,7 @@
 #include <wtf/MonotonicTime.h>
 #include <wtf/NumberOfCores.h>
 #include <wtf/StdLibExtras.h>
+#include <wtf/SystemTracing.h>
 #include <wtf/text/StringBuilder.h>
 
 namespace JSC { namespace Wasm {
@@ -114,6 +115,9 @@ void Plan::run(std::optional<Memory::Mode> recompileMode)
 {
     if (!parseAndValidateModule(recompileMode))
         return;
+
+    TraceScope traceScope(WebAssemblyCompileStart, WebAssemblyCompileEnd);
+
     if (recompileMode)
         ASSERT(m_moduleInformation->memory.mode() == recompileMode);
 
index 04ed666..502bb12 100644 (file)
@@ -41,6 +41,7 @@
 #include "VM.h"
 #include "WasmFormat.h"
 #include "WasmMemory.h"
+#include <wtf/SystemTracing.h>
 
 namespace JSC {
 
@@ -76,6 +77,8 @@ static EncodedJSValue JSC_HOST_CALL callWebAssemblyFunction(ExecState* exec)
         }
     }
 
+    TraceScope traceScope(WebAssemblyExecuteStart, WebAssemblyExecuteEnd);
+
     Vector<JSValue> boxedArgs;
     for (unsigned argIndex = 0; argIndex < signature->argumentCount(); ++argIndex) {
         JSValue arg = exec->argument(argIndex);
index 99ca9f6..8152be9 100644 (file)
@@ -1,3 +1,16 @@
+2017-03-16  Simon Fraser  <simon.fraser@apple.com>
+
+        Improve the system tracing points
+        https://bugs.webkit.org/show_bug.cgi?id=169790
+
+        Reviewed by Zalan Bujtas.
+
+        Use a more cohesive set of system trace points that give a good overview of what
+        WebKit is doing. Added points for resource loading, render tree building, sync messages
+        to the web process, async image decode, WASM and fetching cookies.
+
+        * wtf/SystemTracing.h:
+
 2017-03-16  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [UNIX] Implement currentSearchLocaleID() and currentTextBreakLocaleID()
index 968fd67..1ee67d3 100644 (file)
@@ -43,37 +43,48 @@ enum TracePointCode {
     JavaScriptRange = 2500,
     VMEntryScopeStart,
     VMEntryScopeEnd,
+    WebAssemblyCompileStart,
+    WebAssemblyCompileEnd,
+    WebAssemblyExecuteStart,
+    WebAssemblyExecuteEnd,
 
     WebCoreRange = 5000,
+    MainResourceLoadDidStartProvisional,
+    MainResourceLoadDidEnd,
+    SubresourceLoadWillStart,
+    SubresourceLoadDidEnd,
+    FetchCookiesStart,
+    FetchCookiesEnd,
     StyleRecalcStart,
     StyleRecalcEnd,
+    RenderTreeBuildStart,
+    RenderTreeBuildEnd,
     LayoutStart,
     LayoutEnd,
-    PaintViewStart,
-    PaintViewEnd,
     PaintLayerStart,
     PaintLayerEnd,
-    RAFDisplayLinkScheduled,
-    RAFDisplayLinkFired,
+    AsyncImageDecodeStart,
+    AsyncImageDecodeEnd,
     RAFCallbackStart,
     RAFCallbackEnd,
 
     WebKitRange = 10000,
-    WebKit2Range = 12000,
+    WebHTMLViewPaintStart,
+    WebHTMLViewPaintEnd,
 
-    RAFDidUpdateStart,
-    RAFDidUpdateEnd,
-    RAFBackingStoreFlushStart,
-    RAFBackingStoreFlushEnd,
-    RAFBuildTransactionStart,
-    RAFBuildTransactionEnd,
+    WebKit2Range = 12000,
+    BackingStoreFlushStart,
+    BackingStoreFlushEnd,
+    BuildTransactionStart,
+    BuildTransactionEnd,
+    SyncMessageStart,
+    SyncMessageEnd,
+    SyncTouchEventStart,
+    SyncTouchEventEnd,
 
     UIProcessRange = 14000,
-
-    RAFCommitLayerTreeStart,
-    RAFCommitLayerTreeEnd,
-    RAFDidRefreshDisplayStart,
-    RAFDidRefreshDisplayEnd,
+    CommitLayerTreeStart,
+    CommitLayerTreeEnd,
 };
 
 #ifdef __cplusplus
index 80c60fb..06b3fac 100644 (file)
@@ -1,5 +1,37 @@
 2017-03-16  Simon Fraser  <simon.fraser@apple.com>
 
+        Improve the system tracing points
+        https://bugs.webkit.org/show_bug.cgi?id=169790
+
+        Reviewed by Zalan Bujtas.
+
+        Use a more cohesive set of system trace points that give a good overview of what
+        WebKit is doing. Added points for resource loading, render tree building, sync messages
+        to the web process, async image decode, WASM and fetching cookies.
+
+        * loader/CookieJar.cpp:
+        (WebCore::cookies):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::provisionalLoadStarted):
+        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
+        * loader/SubresourceLoader.cpp:
+        (WebCore::SubresourceLoader::willSendRequestInternal):
+        (WebCore::logResourceLoaded):
+        (WebCore::SubresourceLoader::didFinishLoading):
+        (WebCore::SubresourceLoader::didFail):
+        (WebCore::SubresourceLoader::didCancel):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::paintContents):
+        * platform/graphics/ImageFrameCache.cpp:
+        (WebCore::ImageFrameCache::startAsyncDecodingQueue):
+        * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
+        (WebCore::DisplayRefreshMonitorIOS::requestRefreshCallback):
+        (WebCore::DisplayRefreshMonitorIOS::displayLinkFired):
+        * style/RenderTreeUpdater.cpp:
+        (WebCore::RenderTreeUpdater::commit):
+
+2017-03-16  Simon Fraser  <simon.fraser@apple.com>
+
         RenderView::documentBeingDestroyed() needs a new name.
         https://bugs.webkit.org/show_bug.cgi?id=166727
 
index 3e8a785..6b06168 100644 (file)
@@ -34,6 +34,7 @@
 #include "NetworkingContext.h"
 #include "PlatformCookieJar.h"
 #include "PlatformStrategies.h"
+#include <wtf/SystemTracing.h>
 
 namespace WebCore {
 
@@ -55,6 +56,8 @@ inline NetworkStorageSession& storageSession(const Document& document)
 
 String cookies(const Document& document, const URL& url)
 {
+    TraceScope scope(FetchCookiesStart, FetchCookiesEnd);
+
     return platformStrategies()->cookiesStrategy()->cookiesForDOM(storageSession(document), document.firstPartyForCookies(), url);
 }
 
index e2ed03d..61cc2e9 100644 (file)
 #include <wtf/CurrentTime.h>
 #include <wtf/Ref.h>
 #include <wtf/StdLibExtras.h>
+#include <wtf/SystemTracing.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
 
@@ -991,6 +992,8 @@ void FrameLoader::provisionalLoadStarted()
     m_client.provisionalLoadStarted();
 
     if (m_frame.isMainFrame()) {
+        TracePoint(MainResourceLoadDidStartProvisional);
+
         if (auto* page = m_frame.page())
             page->didStartProvisionalLoad();
     }
@@ -2322,8 +2325,10 @@ void FrameLoader::checkLoadCompleteForThisFrame()
             m_progressTracker->progressCompleted();
             Page* page = m_frame.page();
             if (page) {
-                if (m_frame.isMainFrame())
+                if (m_frame.isMainFrame()) {
+                    TracePoint(MainResourceLoadDidEnd);
                     page->didFinishLoad();
+                }
             }
 
             const ResourceError& error = dl->mainDocumentError();
index 36acae3..fd60262 100644 (file)
@@ -48,6 +48,7 @@
 #include <wtf/Ref.h>
 #include <wtf/RefCountedLeakCounter.h>
 #include <wtf/StdLibExtras.h>
+#include <wtf/SystemTracing.h>
 #include <wtf/text/CString.h>
 
 #if PLATFORM(IOS)
@@ -176,8 +177,10 @@ void SubresourceLoader::willSendRequestInternal(ResourceRequest& newRequest, con
         return;
     }
 
-    if (newRequest.requester() != ResourceRequestBase::Requester::Main)
+    if (newRequest.requester() != ResourceRequestBase::Requester::Main) {
+        TracePoint(SubresourceLoadWillStart);
         ResourceLoadObserver::sharedObserver().logSubresourceLoading(m_frame.get(), newRequest, redirectResponse);
+    }
 
     ASSERT(!newRequest.isNull());
     if (!redirectResponse.isNull()) {
@@ -462,6 +465,7 @@ static void logResourceLoaded(Frame* frame, CachedResource::Type type)
         resourceType = DiagnosticLoggingKeys::otherKey();
         break;
     }
+    
     frame->page()->diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::resourceLoadedKey(), resourceType, ShouldSample::Yes);
 }
 
@@ -552,15 +556,20 @@ void SubresourceLoader::didFinishLoading(const NetworkLoadMetrics& networkLoadMe
     }
 #endif
 
+    if (m_resource->type() != CachedResource::MainResource)
+        TracePoint(SubresourceLoadDidEnd);
+
     m_state = Finishing;
     m_resource->finishLoading(resourceData());
 
     if (wasCancelled())
         return;
+
     m_resource->finish();
     ASSERT(!reachedTerminalState());
     didFinishLoadingOnePart(networkLoadMetrics);
     notifyDone();
+
     if (reachedTerminalState())
         return;
     releaseResources();
@@ -581,6 +590,10 @@ void SubresourceLoader::didFail(const ResourceError& error)
     Ref<SubresourceLoader> protectedThis(*this);
     CachedResourceHandle<CachedResource> protectResource(m_resource);
     m_state = Finishing;
+
+    if (m_resource->type() != CachedResource::MainResource)
+        TracePoint(SubresourceLoadDidEnd);
+
     if (m_resource->resourceToRevalidate())
         MemoryCache::singleton().revalidationFailed(*m_resource);
     m_resource->setResourceError(error);
@@ -626,6 +639,9 @@ void SubresourceLoader::didCancel(const ResourceError&)
     if (m_state == Uninitialized)
         return;
 
+    if (m_resource->type() != CachedResource::MainResource)
+        TracePoint(SubresourceLoadDidEnd);
+
     m_resource->cancelLoad();
     notifyDone();
 }
index b03c7c0..aa0b347 100644 (file)
@@ -4430,8 +4430,6 @@ void FrameView::paintContents(GraphicsContext& context, const IntRect& dirtyRect
     if (m_layoutPhase == InViewSizeAdjust)
         return;
 
-    TraceScope tracingScope(PaintViewStart, PaintViewEnd);
-
     ASSERT(m_layoutPhase == InPostLayerPositionsUpdatedAfterLayout || m_layoutPhase == OutsideLayout);
     
     RenderView* renderView = this->renderView();
index 9eb30da..f0f5a09 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "Image.h"
 #include "ImageObserver.h"
+#include <wtf/SystemTracing.h>
 
 #if USE(CG)
 #include "ImageDecoderCG.h"
@@ -294,6 +295,8 @@ void ImageFrameCache::startAsyncDecodingQueue()
         ImageFrameRequest frameRequest;
 
         while (m_frameRequestQueue.dequeue(frameRequest)) {
+            TraceScope tracingScope(AsyncImageDecodeStart, AsyncImageDecodeEnd);
+
             // Get the frame NativeImage on the decoding thread.
             NativeImagePtr nativeImage = protectedDecoder->createFrameImageAtIndex(frameRequest.index, frameRequest.subsamplingLevel, frameRequest.sizeForDrawing);
 
index ff4c2b6..dce021f 100644 (file)
@@ -32,7 +32,6 @@
 #import <QuartzCore/QuartzCore.h>
 #import <wtf/CurrentTime.h>
 #import <wtf/MainThread.h>
-#import <wtf/SystemTracing.h>
 
 using namespace WebCore;
 
@@ -100,8 +99,6 @@ bool DisplayRefreshMonitorIOS::requestRefreshCallback()
     if (!isActive())
         return false;
 
-    TracePoint(RAFDisplayLinkScheduled);
-    
     if (!m_handler) {
         m_handler = adoptNS([[WebDisplayLinkHandler alloc] initWithMonitor:this]);
         setIsActive(true);
@@ -118,8 +115,6 @@ void DisplayRefreshMonitorIOS::displayLinkFired()
 
     setIsPreviousFrameDone(false);
     handleDisplayRefreshedNotificationOnMainThread(this);
-    
-    TracePoint(RAFDisplayLinkFired);
 }
 
 }
index de67293..6df3bf8 100644 (file)
@@ -40,6 +40,7 @@
 #include "RenderNamedFlowThread.h"
 #include "StyleResolver.h"
 #include "StyleTreeResolver.h"
+#include <wtf/SystemTracing.h>
 
 #if PLATFORM(IOS)
 #include "WKContentObservation.h"
@@ -112,6 +113,8 @@ void RenderTreeUpdater::commit(std::unique_ptr<const Style::Update> styleUpdate)
 
     if (!m_document.shouldCreateRenderers() || !m_document.renderView())
         return;
+    
+    TraceScope scope(RenderTreeBuildStart, RenderTreeBuildEnd);
 
     Style::PostResolutionCallbackDisabler callbackDisabler(m_document);
 
index c073de0..3b626c0 100644 (file)
@@ -1,3 +1,17 @@
+2017-03-16  Simon Fraser  <simon.fraser@apple.com>
+
+        Improve the system tracing points
+        https://bugs.webkit.org/show_bug.cgi?id=169790
+
+        Reviewed by Zalan Bujtas.
+
+        Use a more cohesive set of system trace points that give a good overview of what
+        WebKit is doing. Added points for resource loading, render tree building, sync messages
+        to the web process, async image decode, WASM and fetching cookies.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView drawRect:]):
+
 2017-03-16  Youenn Fablet  <youenn@apple.com>
 
         Wrap legacy WebRTC API in runtime flag
index db2b26b..2ddcd9d 100644 (file)
 #import <wtf/MathExtras.h>
 #import <wtf/ObjcRuntimeExtras.h>
 #import <wtf/RunLoop.h>
+#import <wtf/SystemTracing.h>
 
 #if !PLATFORM(IOS)
 #import "WebNSEventExtras.h"
@@ -4194,6 +4195,8 @@ static BOOL currentScrollIsBlit(NSView *clipView)
 - (void)drawRect:(NSRect)rect
 {
     LOG(View, "%@ drawing", self);
+    
+    TraceScope scope(WebHTMLViewPaintStart, WebHTMLViewPaintEnd);
 
 #if !PLATFORM(IOS)
     const NSRect *rects;
index 8fd5837..871080c 100644 (file)
@@ -1,3 +1,27 @@
+2017-03-16  Simon Fraser  <simon.fraser@apple.com>
+
+        Improve the system tracing points
+        https://bugs.webkit.org/show_bug.cgi?id=169790
+
+        Reviewed by Zalan Bujtas.
+
+        Use a more cohesive set of system trace points that give a good overview of what
+        WebKit is doing. Added points for resource loading, render tree building, sync messages
+        to the web process, async image decode, WASM and fetching cookies.
+
+        * UIProcess/ChildProcessProxy.h:
+        (WebKit::ChildProcessProxy::sendSync):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::handleTouchEventSynchronously):
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
+        * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
+        (WebKit::RemoteLayerTreeContext::buildTransaction):
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
+        (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
+
 2017-03-16  Youenn Fablet  <youenn@apple.com>
 
         Wrap legacy WebRTC API in runtime flag
index a1f5227..c63b9be 100644 (file)
@@ -29,6 +29,7 @@
 #include "MessageReceiverMap.h"
 #include "ProcessLauncher.h"
 
+#include <wtf/SystemTracing.h>
 #include <wtf/ThreadSafeRefCounted.h>
 
 namespace WebKit {
@@ -117,6 +118,8 @@ bool ChildProcessProxy::sendSync(U&& message, typename U::Reply&& reply, uint64_
     if (!m_connection)
         return false;
 
+    TraceScope scope(SyncMessageStart, SyncMessageEnd);
+
     return connection()->sendSync(std::forward<U>(message), WTFMove(reply), destinationID, timeout, sendSyncOptions);
 }
 
index f8a9a3f..61d7cef 100644 (file)
 #include <WebCore/WindowFeatures.h>
 #include <stdio.h>
 #include <wtf/NeverDestroyed.h>
+#include <wtf/SystemTracing.h>
 #include <wtf/text/StringBuilder.h>
 #include <wtf/text/StringView.h>
 
@@ -2179,6 +2180,8 @@ void WebPageProxy::handleTouchEventSynchronously(NativeWebTouchEvent& event)
     if (!isValid())
         return;
 
+    TraceScope scope(SyncTouchEventStart, SyncTouchEventEnd);
+
     if (event.type() == WebEvent::TouchStart)
         updateTouchEventTracking(event);
 
index ad1c06b..fa3c9a8 100644 (file)
@@ -177,7 +177,7 @@ void RemoteLayerTreeDrawingAreaProxy::willCommitLayerTree(uint64_t transactionID
 
 void RemoteLayerTreeDrawingAreaProxy::commitLayerTree(const RemoteLayerTreeTransaction& layerTreeTransaction, const RemoteScrollingCoordinatorTransaction& scrollingTreeTransaction)
 {
-    TraceScope tracingScope(RAFCommitLayerTreeStart, RAFCommitLayerTreeEnd);
+    TraceScope tracingScope(CommitLayerTreeStart, CommitLayerTreeEnd);
 
     LOG(RemoteLayerTree, "%s", layerTreeTransaction.description().data());
     LOG(RemoteLayerTree, "%s", scrollingTreeTransaction.description().data());
@@ -410,8 +410,6 @@ void RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay()
     
     m_didUpdateMessageState = DoesNotNeedDidUpdate;
 
-    TraceScope tracingScope(RAFDidRefreshDisplayStart, RAFDidRefreshDisplayEnd);
-
     // Waiting for CA to commit is insufficient, because the render server can still be
     // using our backing store. We can improve this by waiting for the render server to commit
     // if we find API to do so, but for now we will make extra buffers if need be.
index f4a61a0..ab43ba7 100644 (file)
@@ -107,7 +107,7 @@ std::unique_ptr<GraphicsLayer> RemoteLayerTreeContext::createGraphicsLayer(WebCo
 
 void RemoteLayerTreeContext::buildTransaction(RemoteLayerTreeTransaction& transaction, PlatformCALayer& rootLayer)
 {
-    TraceScope tracingScope(RAFBuildTransactionStart, RAFBuildTransactionEnd);
+    TraceScope tracingScope(BuildTransactionStart, BuildTransactionEnd);
 
     PlatformCALayerRemote& rootLayerRemote = downcast<PlatformCALayerRemote>(rootLayer);
     transaction.setRootLayerID(rootLayerRemote.layerID());
index 5d39446..4cbc0e3 100644 (file)
@@ -437,8 +437,6 @@ void RemoteLayerTreeDrawingArea::flushLayers()
 
 void RemoteLayerTreeDrawingArea::didUpdate()
 {
-    TraceScope tracingScope(RAFDidUpdateStart, RAFDidUpdateEnd);
-
     // FIXME: This should use a counted replacement for setLayerTreeStateIsFrozen, but
     // the callers of that function are not strictly paired.
 
@@ -488,7 +486,7 @@ void RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush()
 {
     ASSERT(!m_hasFlushed);
 
-    TraceScope tracingScope(RAFBackingStoreFlushStart, RAFBackingStoreFlushEnd);
+    TraceScope tracingScope(BackingStoreFlushStart, BackingStoreFlushEnd);
     
     for (auto& context : m_contextsToFlush)
         CGContextFlush(context.get());
index d0f7589..d8cb0e3 100644 (file)
@@ -1,3 +1,16 @@
+2017-03-16  Simon Fraser  <simon.fraser@apple.com>
+
+        Improve the system tracing points
+        https://bugs.webkit.org/show_bug.cgi?id=169790
+
+        Reviewed by Zalan Bujtas.
+
+        Use a more cohesive set of system trace points that give a good overview of what
+        WebKit is doing. Added points for resource loading, render tree building, sync messages
+        to the web process, async image decode, WASM and fetching cookies.
+
+        * Tracing/SystemTracePoints.plist:
+
 2017-03-16  Youenn Fablet  <youenn@apple.com>
 
         Wrap legacy WebRTC API in runtime flag
index 0f4256f..b3141e6 100644 (file)
              </dict>
              <dict>
                  <key>Name</key>
-                 <string>Document::recalcStyle()</string>
+                 <string>Compile WebAssembly</string>
+                 <key>Type</key>
+                 <string>Interval</string>
+                 <key>Component</key>
+                 <string>47</string>
+                 <key>CodeBegin</key>
+                 <string>2503</string>
+                 <key>CodeEnd</key>
+                 <string>2504</string>
+             </dict>
+             <dict>
+                 <key>Name</key>
+                 <string>Execute WebAssembly</string>
+                 <key>Type</key>
+                 <string>Interval</string>
+                 <key>Component</key>
+                 <string>47</string>
+                 <key>CodeBegin</key>
+                 <string>2505</string>
+                 <key>CodeEnd</key>
+                 <string>2506</string>
+             </dict>
+             <dict>
+                 <key>Name</key>
+                 <string>Main Resource Load</string>
                  <key>Type</key>
                  <string>Interval</string>
                  <key>Component</key>
@@ -33,7 +57,7 @@
              </dict>
              <dict>
                  <key>Name</key>
-                 <string>FrameView::layout()</string>
+                 <string>Subresource Load</string>
                  <key>Type</key>
                  <string>Interval</string>
                  <key>Component</key>
@@ -45,7 +69,7 @@
              </dict>
              <dict>
                  <key>Name</key>
-                 <string>FrameView::paintContents()</string>
+                 <string>Fetch Cookies</string>
                  <key>Type</key>
                  <string>Interval</string>
                  <key>Component</key>
@@ -57,7 +81,7 @@
              </dict>
              <dict>
                  <key>Name</key>
-                 <string>GraphicsLayerCA::paintLayerContents()</string>
+                 <string>Style recalc</string>
                  <key>Type</key>
                  <string>Interval</string>
                  <key>Component</key>
@@ -69,7 +93,7 @@
              </dict>
              <dict>
                  <key>Name</key>
-                 <string>DisplayRefreshMonitor</string>
+                 <string>Build render tree</string>
                  <key>Type</key>
                  <string>Interval</string>
                  <key>Component</key>
              </dict>
              <dict>
                  <key>Name</key>
-                 <string>ScriptedAnimationController::serviceScriptedAnimations()</string>
+                 <string>Layout</string>
                  <key>Type</key>
                  <string>Interval</string>
                  <key>Component</key>
              </dict>
              <dict>
                  <key>Name</key>
-                 <string>RemoteLayerTreeDrawingArea::didUpdate()</string>
+                 <string>Paint layer</string>
+                 <key>Type</key>
+                 <string>Interval</string>
+                 <key>Component</key>
+                 <string>47</string>
+                 <key>CodeBegin</key>
+                 <string>5013</string>
+                 <key>CodeEnd</key>
+                 <string>5014</string>
+             </dict>
+             <dict>
+                 <key>Name</key>
+                 <string>Async Image Decode</string>
+                 <key>Type</key>
+                 <string>Interval</string>
+                 <key>Component</key>
+                 <string>47</string>
+                 <key>CodeBegin</key>
+                 <string>5015</string>
+                 <key>CodeEnd</key>
+                 <string>5016</string>
+             </dict>
+             <dict>
+                 <key>Name</key>
+                 <string>requestAnimationFrame</string>
+                 <key>Type</key>
+                 <string>Interval</string>
+                 <key>Component</key>
+                 <string>47</string>
+                 <key>CodeBegin</key>
+                 <string>5017</string>
+                 <key>CodeEnd</key>
+                 <string>5018</string>
+             </dict>
+             <dict>
+                 <key>Name</key>
+                 <string>Paint WebHTMLView</string>
+                 <key>Type</key>
+                 <string>Interval</string>
+                 <key>Component</key>
+                 <string>47</string>
+                 <key>CodeBegin</key>
+                 <string>10001</string>
+                 <key>CodeEnd</key>
+                 <string>10002</string>
+             </dict>
+             <dict>
+                 <key>Name</key>
+                 <string>Flush backing store drawing</string>
                  <key>Type</key>
                  <string>Interval</string>
                  <key>Component</key>
              </dict>
              <dict>
                  <key>Name</key>
-                 <string>RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush()</string>
+                 <string>Build RemoteLayerTree transaction</string>
                  <key>Type</key>
                  <string>Interval</string>
                  <key>Component</key>
              </dict>
              <dict>
                  <key>Name</key>
-                 <string>RemoteLayerTreeContext::buildTransaction()</string>
+                 <string>Sync message</string>
                  <key>Type</key>
                  <string>Interval</string>
                  <key>Component</key>
              </dict>
              <dict>
                  <key>Name</key>
-                 <string>RemoteLayerTreeDrawingAreaProxy::commitLayerTree()</string>
+                 <string>Sync touch event</string>
                  <key>Type</key>
                  <string>Interval</string>
                  <key>Component</key>
                  <string>47</string>
                  <key>CodeBegin</key>
-                 <string>14001</string>
+                 <string>12007</string>
                  <key>CodeEnd</key>
-                 <string>14002</string>
+                 <string>12008</string>
              </dict>
              <dict>
                  <key>Name</key>
-                 <string>RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay()</string>
+                 <string>Commit RemoteLayerTree transaction</string>
                  <key>Type</key>
                  <string>Interval</string>
                  <key>Component</key>
                  <string>47</string>
                  <key>CodeBegin</key>
-                 <string>14003</string>
+                 <string>14001</string>
                  <key>CodeEnd</key>
-                 <string>14004</string>
+                 <string>14002</string>
              </dict>
          </array>
      </dict>