rr-debugger / rr

Record and Replay Framework
http://rr-project.org/
Other
9.16k stars 587 forks source link

is_rr_supported test binary? #3337

Open Manouchehri opened 2 years ago

Manouchehri commented 2 years ago

During my battle yesterday trying to compile rr for cuttlefish arm64, I realized that a simple test binary that just tests for needed perf counters and CPU architecture might save a lot of time before investing effort into getting a full rr build working. We could compile this as a statically-linked PIE with musl, so the same binary could run on almost anything as long as the architecture matches (e.g. Android).

https://git.zv.io/toolchains/musl-cross-make

Thoughts? A "better" solution would be to get rr compiled properly for more target platforms, but that is often more work (which may or may not be useful in the end if it's unsupported).

Manouchehri commented 2 years ago

Feel free to close this ticket if you don't like the idea. =)

rocallahan commented 2 years ago

src/counters-test/counters.c tests the perf counters and CPU architecture. It's a standalone C program that you can compile with a trivial command.

rocallahan commented 2 years ago

It probably needs updating with the latest CPU architecture updates.

Keno commented 2 years ago

@yuyichao has a whole repo for testing counter stability which is helpful in porting. Might be worth importing into the rr source tree and writing up some instructions on.

rocallahan commented 2 years ago

FWIW I wrote src/counters-test/counters.c so that people working on hypervisors etc could have some simple standalone test code suitable for CI.

GitMensch commented 1 year ago

@Manouchehri would you suggest to add something or is the test source "enough" (and possibly needs some documentation, for example on the "will rr work" wiki entry - which is something that I could do...)?