rr icon indicating copy to clipboard operation
rr copied to clipboard

executing rr under WSL2

Open RCoeurjoly opened this issue 1 year ago • 1 comments

In this closed issue (https://github.com/rr-debugger/rr/issues/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 07d2aeb7.

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

RCoeurjoly avatar Feb 16 '24 23:02 RCoeurjoly

Does perf stat /bin/ls work for you?

rocallahan avatar Feb 29 '24 19:02 rocallahan

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

RCoeurjoly avatar Aug 17 '24 11:08 RCoeurjoly

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

rocallahan avatar Aug 17 '24 11:08 rocallahan

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

RCoeurjoly avatar Aug 17 '24 11:08 RCoeurjoly

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

rocallahan avatar Aug 17 '24 11:08 rocallahan