On Tue, Feb 26, 2013 at 05:16:48PM +0400, Евард Вадим wrote: > Hi list, > Our team is now surveying various binary translation and emulation tools, and > as part of this work we have to measure time spent in different parts of the > process. > More precisely, I'd like to make this work on x86_64-linux-user qemu without > any accelerations. > If article [1] is still relevant, I see the following places to spend time: > 1. Locate end of translation block > 2. Disassemble it to IR > 3. Assemble x86_64 machine code > 4. Execute it > 5. Process syscalls > 6. .. What else?
The flow above is right, I would suggest you reading the source code to get more familar with QEMU. > What is the best method to measure these times you'd suggest? > ./configure mentions 4 things I found relevant: > 1. --enable-debug-tcg (didn't look at it yet) > 2. --enable-trace-backend=B > 3. --enable-profiler (some things like qemu_time seem relevant, didn't look > closely yet) > 4. --enable-gprof (I encountered problems when building and/or running qemu > with gprof) You can get profiling about QEMU itself by using usual measurement, I guess. The problem is how you get the time spent is the code cache. I guess you have to spot where QEMU jump into the code cache, and when/where it leave the code cache. Then insert your profiling code there. HTH, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj