### Run sampling profiler with X87_SAMPLE output file Source: https://github.com/athei/x87sidecar/blob/master/README.md Set X87_SAMPLE to a file path to enable the sampling profiler. The path gets a . suffix appended (e.g., /tmp/game.prof becomes /tmp/game.prof.12345), using the pid of the attached process. The sampler reads the running thread's ARM pc and resolves it to the guest x86 pc via Rosetta's per-fragment instruction maps, without suspending the target. ```bash X87_SAMPLE=/tmp/game.prof ./x87sidecar_entitled ./program ``` -------------------------------- ### Build x87sidecar with CMake Source: https://github.com/athei/x87sidecar/blob/master/README.md Configures and builds the project in the build directory. Produces build/bin/x87sidecar, build/bin/x87sidecar_entitled, the tools, and the x86-64 test and benchmark binaries. ```bash cmake -B build cmake --build build ``` -------------------------------- ### Run test and benchmark scripts Source: https://github.com/athei/x87sidecar/blob/master/README.md Commands for the test harness and benchmark runner. The harness runs 90 self-checking x86-64 test binaries under stock Rosetta and then under the sidecar in ten configurations; the stock run is the baseline, and failures there are reported XFAIL unless listed in KNOWN_STOCK_DIVERGENCE. `--no-build` skips the build, `--native-only` runs only the stock Rosetta baseline, and a bare test name runs a single test. ```bash bash scripts/run_tests.sh # build + all phases bash scripts/run_tests.sh --no-build # skip the build bash scripts/run_tests.sh --native-only # stock Rosetta baseline only bash scripts/run_tests.sh test_arith # one test python3 scripts/test_profile_paths.py # concurrent profiler output paths python3 scripts/test_unhooked_fallback.py # unhooked fallback, no privileges bash scripts/run_benchmarks.sh # build + benchmark table ``` -------------------------------- ### Download, clear quarantine, and run x87sidecar Source: https://github.com/athei/x87sidecar/blob/master/README.md Extract the entitled asset, clear the macOS quarantine attribute, probe Rosetta support, and run an x86 program. The first launch asks for developer-tools authorization once per login session. ```bash tar xf x87sidecar_entitled.tar.xz xattr -d com.apple.quarantine x87sidecar_entitled ./x87sidecar_entitled --probe # is this Rosetta supported? ./x87sidecar_entitled ./some_x86_program args # run it faster ```