qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Newcomer -- clock issue


From: Victor Clement
Subject: Re: [Qemu-devel] Newcomer -- clock issue
Date: Tue, 19 May 2015 11:42:53 +0200 (CEST)

Hello, 

Check the icount option, which uses the virtual cpu instrution counter
to calculate the value of QEMU_CLOCK_VIRTUAL. This is not exactly what
you want because the clock will still run when qemu is preempted by the
host but this is the closest thing you have.

I'm working on a patch that will enable using only the instruction
counter to get pure virtual time and will submit it next week.


Victor

----- Mail original -----
> De: "françois Guerret" <address@hidden>
> À: address@hidden
> Envoyé: Dimanche 17 Mai 2015 22:23:43
> Objet: [Qemu-devel] Newcomer -- clock issue
> 
> 
> 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]