qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] emulation cycle number implementation


From: Peter Maydell
Subject: Re: [Qemu-devel] emulation cycle number implementation
Date: Thu, 7 Sep 2017 17:37:49 +0100

On 7 September 2017 at 17:30, Sergey Smolov <address@hidden> wrote:
> I'm running MIPS assembler programs on QEMU. I need to log some events that
> happen through emulation (writes to some registers, for example). When an
> event happens, I need to print not only the event-related information, but
> an "emulation cycle number" also. This number should be an integer
> increasing value that is similar to real hardware clock.
>
> How to implement this in QEMU? May QEMU timers be helpful in solving such a
> problem?

You can use cpu_get_ticks(), though if we're not in icount mode
you may find it doesn't behave quite as helpfully as you might like
(in that case it roughly tracks host hardware cycles.)

thanks
-- PMM



reply via email to

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