Skip to content

Add wkdev-setup-debugging host script #24

Open
@TingPing

Description

@TingPing
Member
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.

Activity

nikolaszimmermann

nikolaszimmermann commented on Sep 27, 2024

@nikolaszimmermann
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.

ghost

ghost commented on Feb 11, 2025

@ghost

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.

ghost

ghost commented on Feb 11, 2025

@ghost

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

Metadata

Metadata

Labels

wkdev scriptsIssues with scripts provided

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @fred-wang@TingPing@nikolaszimmermann

      Issue actions

        Add wkdev-setup-debugging host script · Issue #24 · Igalia/webkit-container-sdk