Stefan Weil <[email protected]> writes:
> Am 23.01.21 um 09:59 schrieb Wataru Ashihara: > >> Actually I use TCI also on macOS. Like the use case quoted by Philippe, >> there're even other reasons to use TCI: >> >> 1. Learning TCG ops. >> 2. Debugging QEMU with gdb. e.g. diagnose codegen or stepping into >> helper functions from tci.c:tcg_qemu_tb_exec(). >> 3. Guest instruction tracing. TCI is faster than TCG or KVM when tracing >> the guest ops [1]. I guess qira is using TCI for this reason [2]. >> >> [1]: https://twitter.com/wata_ash/status/1352899988032942080 >> [2]: https://github.com/geohot/qira/blob/v1.3/tracers/qemu_build.sh#L55 > > > Yes, TCI can help a lot for debugging, especially also when porting TCG > to a new host architecture. > > If we had binaries which can switch from native to interpreted TCG, it > could also be a reference implementation used for unit tests, comparing > the results for each TCG opcode. > > Using TCI with profiling like gprof is useful to count the frequency of > the different TCG opcodes in practical scenarios and can be used to > detect bottlenecks (and less frequent or unused opcodes) for native TCG, > too. FWIW I had a bunch of JIT profiling changes that exposed the TCG op counts via the JIT profiler. I think I even enabled the op counting by default because it was fairly lightweight to add. IOW I think more introspection can be brought into the core TCG code rather than relying on TCI to achieve it. -- Alex Bennée
