Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wkdev-setup-debugging host script #24

Open
TingPing opened this issue Jun 4, 2024 · 4 comments
Open

Add wkdev-setup-debugging host script #24

TingPing opened this issue Jun 4, 2024 · 4 comments
Assignees
Labels
wkdev scripts Issues with scripts provided

Comments

@TingPing
Copy link
Member

TingPing commented Jun 4, 2024

patrick@wkdev:~/checkout/WebKit$ rr record echo 'hello world'
rr needs /proc/sys/kernel/perf_event_paranoid <= 1, but it is 2.
Change it to 1, or use 'rr record -n' (slow).
Consider putting 'kernel.perf_event_paranoid = 1' in /etc/sysctl.d/10-rr.conf.
See 'man 8 sysctl', 'man 5 sysctl.d' (systemd systems)
and 'man 5 sysctl.conf' (non-systemd systems) for more details.
@TingPing TingPing added the wkdev scripts Issues with scripts provided label Jun 4, 2024
@nikolaszimmermann
Copy link
Member

I'm not sure anymore if we really need this. rr is actually nice and explains what you need to do on your host system.
How about we just add a README.md section for tools like rr/perf/etc. and describe with a few sentences what needs to be done on the host -- there are so many host distros, that handle things differently, probably hard to script it.

@fred-wang
Copy link
Member

@mbrodesser-Igalia
Copy link
Member

I'm not sure anymore if we really need this. rr is actually nice and explains what you need to do on your host system. How about we just add a README.md section for tools like rr/perf/etc. and describe with a few sentences what needs to be done on the host -- there are so many host distros, that handle things differently, probably hard to script it.

Running WebKitGTK's MiniBrowser on the host system fails on Ubuntu 24.04; that is, without rr:

$ Tools/Scripts/run-minibrowser --gtk --debug
/home/mirko/work/code/WebKit/WebKitBuild/GTK/Debug/bin/MiniBrowser: error while loading shared libraries: libocdm.so: cannot open shared object file: No such file or directory

ScriptError raised: Failed to run "['/home/mirko/work/code/WebKit/WebKitBuild/GTK/Debug/bin/MiniBrowser']" exit_code: 127 cwd: /home/mirko/work/code/WebKit
Traceback (most recent call last):
  File "/home/mirko/work/code/WebKit/Tools/Scripts/webkitpy/minibrowser/run_webkit_app.py", line 65, in main
    return port.run_minibrowser(browser_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mirko/work/code/WebKit/Tools/Scripts/webkitpy/port/gtk.py", line 188, in run_minibrowser
    return self._executive.run_command(command + args, cwd=self.webkit_base(), stdout=None, return_stderr=False, decode_output=False, env=env, pass_fds=pass_fds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mirko/work/code/WebKit/Tools/Scripts/webkitpy/common/system/executive.py", line 425, in run_command
    (error_handler or self.default_error_handler)(script_error)
  File "/home/mirko/work/code/WebKit/Tools/Scripts/webkitpy/common/system/abstractexecutive.py", line 98, in default_error_handler
    raise error
webkitpy.common.system.executive.ScriptError: Failed to run "['/home/mirko/work/code/WebKit/WebKitBuild/GTK/Debug/bin/MiniBrowser']" exit_code: 127 cwd: /home/mirko/work/code/WebKit

so it'd be convenient if rr in a webkit-container-sdk works without further configuration steps.

@mbrodesser-Igalia
Copy link
Member

FWIW, this is https://github.com/rr-debugger/rr/wiki/Building-And-Installing#os-configuration

That fixes

$ rr record --bind-to-cpu=0 echo 'hello world'
rr: Saving execution to trace directory `/home/mirko/.local/share/rr/echo-8'.
hello world

--bind-to-cpu=0 was required because of rr-debugger/rr#3338 (comment).

Recording a WebKitGTK MiniBrowser run fails:

$ WEBKIT_MINI_BROWSER_PREFIX="rr record --bind-to-cpu=0" Tools/Scripts/run-minibrowser --gtk --debug
rr: Saving execution to trace directory `/home/mirko/.local/share/rr/MiniBrowser-10'.
bwrap: Can't create tmpfile for /.flatpak-info: File exists

** (MiniBrowser:20465): ERROR **: 15:55:51.179: Failed to fully launch dbus-proxy: Child process exited with code 1

ScriptError raised: Failed to run "['rr', 'record', '--bind-to-cpu=0', '/host/home/mirko/work/code/WebKit/WebKitBuild/GTK/Debug/bin/MiniBrowser']" exit_code: -5 cwd: /host/home/mirko/work/code/WebKit
Traceback (most recent call last):
  File "/host/home/mirko/work/code/WebKit/Tools/Scripts/webkitpy/minibrowser/run_webkit_app.py", line 65, in main
    return port.run_minibrowser(browser_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/host/home/mirko/work/code/WebKit/Tools/Scripts/webkitpy/port/gtk.py", line 188, in run_minibrowser
    return self._executive.run_command(command + args, cwd=self.webkit_base(), stdout=None, return_stderr=False, decode_output=False, env=env, pass_fds=pass_fds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/host/home/mirko/work/code/WebKit/Tools/Scripts/webkitpy/common/system/executive.py", line 425, in run_command
    (error_handler or self.default_error_handler)(script_error)
  File "/host/home/mirko/work/code/WebKit/Tools/Scripts/webkitpy/common/system/abstractexecutive.py", line 98, in default_error_handler
    raise error
webkitpy.common.system.executive.ScriptError: Failed to run "['rr', 'record', '--bind-to-cpu=0', '/host/home/mirko/work/code/WebKit/WebKitBuild/GTK/Debug/bin/MiniBrowser']" exit_code: -5 cwd: /host/home/mirko/work/code/WebKit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wkdev scripts Issues with scripts provided
Projects
None yet
Development

No branches or pull requests

4 participants