Open Manouchehri opened 2 years ago
Feel free to close this ticket if you don't like the idea. =)
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.
It probably needs updating with the latest CPU architecture updates.
@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.
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.
@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...)?
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).