flamegraph-rs / flamegraph

Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unable to sample on WSL2

FilipAndersson245 opened this issue · comments

Hello im trying to use tool on my windows11 WSL, but it is unable to produce any data.

[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.004 MB perf.data ]
writing flamegraph to "flamegraph.svg"
Error: unable to generate a flamegraph from the collapsed stack data

Caused by:
    0: I/O error: No stack counts found
    1: No stack counts found

I installed perf according to the instructions here, building it from microsofts github.
https://gist.github.com/abel0b/b1881e41b9e1c4b16d84e5e083c38a13

image

if i run perf on the project

odin@valhalla:~/advent-of-code$ perf stat ./target/release/advent-of-code 1>/dev/null

 Performance counter stats for './target/release/advent-of-code':

              0.30 msec task-clock                #    0.587 CPUs utilized
                 0      context-switches          #    0.000 /sec
                 0      cpu-migrations            #    0.000 /sec
                72      page-faults               #  237.232 K/sec
   <not supported>      cycles
   <not supported>      instructions
   <not supported>      branches
   <not supported>      branch-misses

       0.000517259 seconds time elapsed

       0.000557000 seconds user
       0.000000000 seconds sys


running

wsl --update
wsl --shutdown

seem to have fixed it
image