Title: [293893] trunk/Source/WebKit
Revision
293893
Author
pvol...@apple.com
Date
2022-05-06 08:58:40 -0700 (Fri, 06 May 2022)

Log Message

Create reports for long process launch times
https://bugs.webkit.org/show_bug.cgi?id=240127

Reviewed by Yusuke Suzuki.

We have reports that it can take a long time to launch WebKit processes in some cases. This is the time
it takes from the XPC message is sent until the XPC reply is received. Add reporting when this happens
in order to help diagnose the issue.

* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::connect):
(WebKit::AuxiliaryProcessProxy::didFinishLaunching):
* UIProcess/AuxiliaryProcessProxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (293892 => 293893)


--- trunk/Source/WebKit/ChangeLog	2022-05-06 15:23:27 UTC (rev 293892)
+++ trunk/Source/WebKit/ChangeLog	2022-05-06 15:58:40 UTC (rev 293893)
@@ -1,5 +1,21 @@
 2022-05-06  Per Arne Vollan  <pvol...@apple.com>
 
+        Create reports for long process launch times
+        https://bugs.webkit.org/show_bug.cgi?id=240127
+
+        Reviewed by Yusuke Suzuki.
+
+        We have reports that it can take a long time to launch WebKit processes in some cases. This is the time 
+        it takes from the XPC message is sent until the XPC reply is received. Add reporting when this happens 
+        in order to help diagnose the issue.
+        
+        * UIProcess/AuxiliaryProcessProxy.cpp:
+        (WebKit::AuxiliaryProcessProxy::connect):
+        (WebKit::AuxiliaryProcessProxy::didFinishLaunching):
+        * UIProcess/AuxiliaryProcessProxy.h:
+
+2022-05-06  Per Arne Vollan  <pvol...@apple.com>
+
         [WP] Wait for Launch Services database after Network process connection has been established
         https://bugs.webkit.org/show_bug.cgi?id=240125
         <rdar://92107043>

Modified: trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp (293892 => 293893)


--- trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp	2022-05-06 15:23:27 UTC (rev 293892)
+++ trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp	2022-05-06 15:58:40 UTC (rev 293893)
@@ -108,6 +108,7 @@
 void AuxiliaryProcessProxy::connect()
 {
     ASSERT(!m_processLauncher);
+    m_proccessStart = MonotonicTime::now();
     ProcessLauncher::LaunchOptions launchOptions;
     getLaunchOptions(launchOptions);
     m_processLauncher = ProcessLauncher::create(this, WTFMove(launchOptions));
@@ -257,6 +258,10 @@
     ASSERT(!m_connection);
     ASSERT(isMainRunLoop());
 
+    auto launchTime = MonotonicTime::now() - m_proccessStart;
+    if (launchTime > 1_s)
+        RELEASE_LOG_FAULT(Process, "%s process (%p) took %f seconds to launch", processName().characters(), this, launchTime.value());
+    
     if (!IPC::Connection::identifierIsValid(connectionIdentifier))
         return;
 

Modified: trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h (293892 => 293893)


--- trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h	2022-05-06 15:23:27 UTC (rev 293892)
+++ trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h	2022-05-06 15:58:40 UTC (rev 293893)
@@ -187,6 +187,7 @@
     bool m_didBeginResponsivenessChecks { false };
     WebCore::ProcessIdentifier m_processIdentifier { WebCore::ProcessIdentifier::generate() };
     std::optional<UseLazyStop> m_delayedResponsivenessCheck;
+    MonotonicTime m_proccessStart;
 };
 
 template<typename T>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to