Skip to content

When profiling, it’s important to know what x86 code the recompiled RISC-V code corresponds to.

For this, you should use the newer perf jitdump interface.

Usage

Start a game with the option enabled:

FELIX86_PERF_JITDUMP=1 felix86 /path/to/my/game
or simply set it in the Steam profile of the game:
# Set APPID to your Steam game id. It can be found in the store page URL
# For example, Half-Life 2 is 220, as seen in its URL: https://store.steampowered.com/app/220/HalfLife_2/
export APPID=220
cat >> ~/.config/felix86/profiles/steam/$APPID.toml <<'EOF'

[Debugging]
perf_jitdump = true
EOF

Then you can capture some samples:

export PID=1234
perf record -k mono -e cpu-clock -F 499 -m 8 -p $PID -o perf.data

And report, after injecting the emitted jit data:

perf inject --jit -i perf.data -o jit.data
perf report -i jit.data

x86 ELF symbols can also be emitted with FELIX86_PERF_SYMBOLS, although this option is rarely used and is badly optimized.