llvm-test-suite
llvm-test-suite copied to clipboard
Add litsupport module to collect QEMU plugin metrics
This is a pretty basic module I've been using that I thought I'd post here in case others find it useful. It allows you to capture the logs from QEMU plugins and store them in the metrics for comparison with compare.py.
For example you can use the example plugin libinsn.so to gather the dynamic instruciton count:
$ cmake -B build -DTEST_SUITE_RUN_UNDER='qemu-foo -plugin libinsn.so -d plugin' \
-DTEST_SUITE_EXTRA_LIT_MODULES=qemulog \
-DTEST_SUITE_USER_MODE_EMULATION=ON
$ cmake --build build
$ lit build -o result.json
$ ./compare.py result.json -m 'total insns'
At the moment it only works if the plugin outputs metrics in 'foo:count' format, with one on each line.