[GTK] Allow to use WebMemorySampler feature.
authorclopez@igalia.com <clopez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Nov 2016 08:46:13 +0000 (08:46 +0000)
committerclopez@igalia.com <clopez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Nov 2016 08:46:13 +0000 (08:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=164517

Reviewed by Carlos Garcia Campos.

Enable the WebMemorySampler with the environment variable WEBKIT_SAMPLE_MEMORY.

When enabled, it will dump the stats to /tmp each second.

* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextConstructed):

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp

index becd8cf..535e206 100644 (file)
@@ -1,3 +1,17 @@
+2016-11-10  Carlos Alberto Lopez Perez  <clopez@igalia.com>
+
+        [GTK] Allow to use WebMemorySampler feature.
+        https://bugs.webkit.org/show_bug.cgi?id=164517
+
+        Reviewed by Carlos Garcia Campos.
+
+        Enable the WebMemorySampler with the environment variable WEBKIT_SAMPLE_MEMORY.
+
+        When enabled, it will dump the stats to /tmp each second.
+
+        * UIProcess/API/gtk/WebKitWebContext.cpp:
+        (webkitWebContextConstructed):
+
 2016-11-10  Philippe Normand  <pnormand@igalia.com>
 
         [WK2][GTK][GStreamer] Build fails when -plugins-base and -core headers are not installed in the same directory
index f077b0c..82bb6cf 100644 (file)
@@ -280,6 +280,11 @@ static void webkitWebContextConstructed(GObject* object)
     priv->tlsErrorsPolicy = WEBKIT_TLS_ERRORS_POLICY_FAIL;
     priv->processPool->setIgnoreTLSErrors(false);
 
+#if ENABLE(MEMORY_SAMPLER)
+    if (getenv("WEBKIT_SAMPLE_MEMORY"))
+        priv->processPool->startMemorySampler(0);
+#endif
+
     attachInjectedBundleClientToContext(webContext);
     attachDownloadClientToContext(webContext);
     attachRequestManagerClientToContext(webContext);