Add logging to facilitate binding of WebContent and Network processes to UI process
authorkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Jan 2018 21:30:23 +0000 (21:30 +0000)
committerkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Jan 2018 21:30:23 +0000 (21:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=182066

Reviewed by Brent Fulgham.

When examining sysdiagnose logs and tracing events from one process to
another, it would be helpful to know which WebKit processes were
related to each other. When Safari, Mail, Messages, etc. are all
running at the same time, it may otherwise be difficult to know if a
particular Network process, for example was associated with Safari or
some other application. Add some logging to the creation of WebContent
and Network processes to identify their "presenting process" (parent
application).

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* Platform/Logging.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

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

Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkProcess.cpp
Source/WebKit/Platform/Logging.h
Source/WebKit/WebProcess/WebProcess.cpp

index 5055032..c4d18fb 100644 (file)
@@ -1,3 +1,25 @@
+2018-01-25  Keith Rollin  <krollin@apple.com>
+
+        Add logging to facilitate binding of WebContent and Network processes to UI process
+        https://bugs.webkit.org/show_bug.cgi?id=182066
+
+        Reviewed by Brent Fulgham.
+
+        When examining sysdiagnose logs and tracing events from one process to
+        another, it would be helpful to know which WebKit processes were
+        related to each other. When Safari, Mail, Messages, etc. are all
+        running at the same time, it may otherwise be difficult to know if a
+        particular Network process, for example was associated with Safari or
+        some other application. Add some logging to the creation of WebContent
+        and Network processes to identify their "presenting process" (parent
+        application).
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::initializeNetworkProcess):
+        * Platform/Logging.h:
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+
 2018-01-25  Youenn Fablet  <youenn@apple.com>
 
         DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
index 185586b..d1d792e 100644 (file)
@@ -259,6 +259,8 @@ void NetworkProcess::initializeNetworkProcess(NetworkProcessCreationParameters&&
 
     for (auto& supplement : m_supplements.values())
         supplement->initialize(parameters);
+
+    RELEASE_LOG(Process, "%p - NetworkProcess::initializeNetworkProcess: Presenting process = %d", this, WebCore::presentingApplicationPID());
 }
 
 void NetworkProcess::initializeConnection(IPC::Connection* connection)
index 8e90b02..f5bc40a 100644 (file)
@@ -58,6 +58,7 @@ extern "C" {
     M(PerformanceLogging) \
     M(Plugins) \
     M(Printing) \
+    M(Process) \
     M(ProcessSuspension) \
     M(RemoteLayerTree) \
     M(Resize) \
index 96f3b40..af2a95a 100644 (file)
@@ -425,6 +425,8 @@ void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters)
 #if HAVE(CFNETWORK_STORAGE_PARTITIONING) && !RELEASE_LOG_DISABLED
     ResourceLoadObserver::shared().setShouldLogUserInteraction(parameters.shouldLogUserInteraction);
 #endif
+
+    RELEASE_LOG(Process, "%p - WebProcess::initializeWebProcess: Presenting process = %d", this, WebCore::presentingApplicationPID());
 }
 
 void WebProcess::registerURLSchemeAsEmptyDocument(const String& urlScheme)