Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: cb1a4a419f2189c993f8e1e8df93d08800750b0f
https://github.com/WebKit/WebKit/commit/cb1a4a419f2189c993f8e1e8df93d08800750b0f
Author: Georges Basile Stavracas Neto <[email protected]>
Date: 2024-07-05 (Fri, 05 Jul 2024)
Changed paths:
M Source/JavaScriptCore/jit/JITPlan.cpp
M Source/WTF/wtf/PlatformGTK.cmake
M Source/WTF/wtf/PlatformWPE.cmake
M Source/WTF/wtf/SystemTracing.h
A Source/WTF/wtf/glib/SysprofAnnotator.h
M Source/WebCore/dom/Document.cpp
M Source/WebKit/GPUProcess/glib/GPUProcessMainGLib.cpp
M Source/WebKit/UIProcess/API/glib/WebKitInitialize.cpp
M Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp
M Source/WebKit/WebProcess/gtk/WebProcessMainGtk.cpp
M Source/WebKit/WebProcess/wpe/WebProcessMainWPE.cpp
M Tools/Scripts/webkitpy/common/system/abstractexecutive.py
M Tools/Scripts/webkitpy/common/system/executive.py
M Tools/Scripts/webkitpy/common/system/executive_mock.py
M Tools/Scripts/webkitpy/port/gtk.py
Log Message:
-----------
[WPE][GTK][WTF] Implement SystemTracing.h with Sysprof
https://bugs.webkit.org/show_bug.cgi?id=275314
Reviewed by Nikolas Zimmermann and Michael Catanzaro.
Implement the tracing macros provided by SystemTracing.h using the
Sysprof collector API.
Sysprof collector operates by passing a control fd as an environment
variable. This env var is set when running any executable with the
sysprof-cli utility, or through Sysprof's main interface.
The control fd needs to be propagated to child processes properly. For
the case of run-minibrowser script - a Python script that spawns the
actual MiniBrowser executable - and for the subprocess launcher. To do
that, duplicate the control fd and pass it as an environment variable
to subprocesses well. The Python script neatly supports that, but the
subprocess launcher needed some more manual mangling to get that done.
This initial work covers all pre-existing tracing groups implemented
on kdebug.
This patch does not introduce new tracing points.
There are limitations with the tracing macros though, for example,
they are most meaningful when there's a single WebKit view running.
Once more views are created, they all output into the same tracing
group. In the future, this can be fixed by using the subprocesses'
pids as part of the tracing name, but right now it's most useless
as the sandbox makes all subprocesses have pid 3.
Another limitation is that tracing only truly works when disabling
the sandboxing of subprocesses. Working around it might require some
reengineering of the subprocess launching mechanism, so this is left
out of this patch as well.
To run WebKitGTK with Sysprof tracing, run the following command in
the WebKit source directory:
```
$ sysprof-cli --force -e WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1 --
Tools/Scripts/run-minibrowser --gtk
```
For WPE WebKit, run the following command:
```
$ sysprof-cli --force -e WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1 --
Tools/Scripts/run-minibrowser --wpe
```
It is also possible to get GNOME Shell marks by passing `--gnome-shell`
to the sysprof-cli command.
Co-authored-by: Carlos Garcia Campos <[email protected]>
* Source/JavaScriptCore/jit/JITPlan.cpp:
(JSC::JITPlan::compileInThread):
* Source/WTF/wtf/PlatformGTK.cmake:
* Source/WTF/wtf/PlatformWPE.cmake:
* Source/WTF/wtf/SystemTracing.h:
(WTF::tracePoint):
* Source/WTF/wtf/glib/SysprofAnnotator.h: Added.
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::setReadyState):
* Source/WebKit/GPUProcess/glib/GPUProcessMainGLib.cpp:
(WebKit::GPUProcessMain):
* Source/WebKit/UIProcess/API/glib/WebKitInitialize.cpp:
(WebKit::webkitInitialize):
* Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):
* Source/WebKit/WebProcess/gtk/WebProcessMainGtk.cpp:
* Source/WebKit/WebProcess/wpe/WebProcessMainWPE.cpp:
* Tools/Scripts/webkitpy/common/system/abstractexecutive.py:
(AbstractExecutive.run_command):
* Tools/Scripts/webkitpy/common/system/executive.py:
(Executive.run_command):
* Tools/Scripts/webkitpy/common/system/executive_mock.py:
(MockExecutive.run_command):
* Tools/Scripts/webkitpy/port/gtk.py:
(GtkPort.run_minibrowser):
Canonical link: https://commits.webkit.org/280690@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes