qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Newcomer -- clock issue


From: françois Guerret
Subject: [Qemu-devel] Newcomer -- clock issue
Date: Sun, 17 May 2015 22:23:43 +0200

Hello,

I am a newcomer on QEMU so I would like to ask a few questions about the way QEMU works before beginning to  develop.

After some experiments and after having read the source code I understood that the time (the clocks) on which the timers are based in QEMU depends:
  • on the host clock
  • on the scheduling policy of the host, since the timers seem to continue running even when qemu program execution is preempted by the host's OS. Actually, the timers seem to be based on "real time" (i mean watch clock) and not on a "machine time".
  • on qemu execution time
What I would need is to base timers on a time which increase only when qemu is really running.
Actually, I want to control the execution time of some code thanks to timers and i need timers which "stop":
  • when qemu is preempted by the host OS
  • when qemu is not running user code


Before going further, could you confirm me that there is no existing option which enables to do that ?

This may be (and may be not) how this problem could be solve  (just an ideas, not an implementation solution): to count the n instructions executed (at block level if it is too costly to do it at instruction level) on the target emulated since the last update and to increment timers with n*mean_execution_time_of_one instruction_on_target. This would not be very precise but better than nothing. It would be much less difficult than counting all instructions of each kind and multiply them by there proper mean execution time which would be a better solution (the very best solution should be to compute these times taking into account the access times to memory and caches which can change for every instruction ...).

Do you think it would be a good idea to specify and implement that solution to offer a supplementary option to the user ?
If yes, could you please explain me how I must proceed to offer a branch development to one of the current qemu version developped ?
If you have any idea about where to begin to deal with this issue, all suggestions are welcomed ...

Thanks in advance.

Francois

reply via email to

[Prev in Thread] Current Thread [Next in Thread]