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

executing rr under WSL2 #3688

Closed
RCoeurjoly opened this issue Feb 16, 2024 · 5 comments
Closed

executing rr under WSL2 #3688

RCoeurjoly opened this issue Feb 16, 2024 · 5 comments

Comments

@RCoeurjoly
Copy link

In this closed issue (#2506), I see rr should support for WSL2.

I have the following WSL2 running:

 wsl --version
WSL version: 2.0.14.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3155

I have compiled rr, using commit 07d2aeb.

I have also compiled perf from source, checking out the kernel version I am using (5.15)

git clone --depth 1 --branch v5.15 https://github.com/torvalds/linux.git
cd linux/tools/perf

Still, when I run rr I get the following error:

[FATAL src/PerfCounters.cc:321:start_counter()] Unable to open performance counter with 'perf_event_open'; are hardware perf events available? See https://github.com/rr-debugger/rr/wiki/Will-rr-work-on-my-system

@rocallahan
Copy link
Collaborator

Does perf stat /bin/ls work for you?

@RCoeurjoly
Copy link
Author

Yes, it gives the following:

perf stat /bin/ls

build CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE release-process scripts src Vagrantfile
CMakeLists.txt configure include README.md rr.spec snap third-party

Performance counter stats for '/bin/ls':

          1.15 msec task-clock:u              #    0.637 CPUs utilized
             0      context-switches:u        #    0.000 /sec
             0      cpu-migrations:u          #    0.000 /sec
            89      page-faults:u             #   77.076 K/sec

cycles:u
instructions:u
branches:u
branch-misses:u

   0.001813222 seconds time elapsed

   0.001869000 seconds user
   0.000000000 seconds sys

Note that I had to install perf like this:
apt install linux-tools-generic
And the symlink into /usr/bin/perf

ln -fs /usr/lib/linux-tools/5.15.0-118-generic/perf /usr/bin/perf

@rocallahan
Copy link
Collaborator

Did you get any results for cycles or branches? Your output looks corrupted.

@RCoeurjoly
Copy link
Author

No, I get not supported. It seems github removed that from the quote block:

perf stat /bin/ls
build CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE release-process scripts src Vagrantfile
CMakeLists.txt configure include README.md rr.spec snap third-party

Performance counter stats for '/bin/ls':

          1.00 msec task-clock                #    0.631 CPUs utilized
             0      context-switches          #    0.000 /sec
             0      cpu-migrations            #    0.000 /sec
            91      page-faults               #   90.710 K/sec

<not supported> cycles
<not supported> instructions
<not supported> branches
<not supported> branch-misses

   0.001589327 seconds time elapsed

   0.001571000 seconds user
   0.000000000 seconds sys

@rocallahan
Copy link
Collaborator

So the hardware events simply do not work in your WSL2 setup. I can't help you with that.

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

No branches or pull requests

2 participants