qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying cl


From: Pavel Dovgaluk
Subject: Re: [Qemu-devel] [RFC PATCH v7 12/21] replay: recording and replaying clock ticks
Date: Mon, 12 Jan 2015 15:43:21 +0300

> From: Paolo Bonzini [mailto:address@hidden
> On 12/01/2015 13:00, Pavel Dovgalyuk wrote:
> > diff --git a/replay/replay.h b/replay/replay.h
> > index 90a949b..1c18c0e 100755
> > --- a/replay/replay.h
> > +++ b/replay/replay.h
> > @@ -16,6 +16,16 @@
> >  #include <stdint.h>
> >  #include "qapi-types.h"
> >
> > +/* replay clock kinds */
> > +/* rdtsc */
> > +#define REPLAY_CLOCK_REAL_TICKS 0
> > +/* host_clock */
> > +#define REPLAY_CLOCK_HOST       1
> > +/* virtual_rt_clock */
> > +#define REPLAY_CLOCK_VIRTUAL_RT 2
> > +
> > +#define REPLAY_CLOCK_COUNT      3
> > +
> >  extern ReplayMode replay_mode;
> >  extern char *replay_image_suffix;
> >
> > @@ -47,6 +57,19 @@ bool replay_interrupt(void);
> >      Returns true, when interrupt request is pending */
> >  bool replay_has_interrupt(void);
> >
> > +/* Processing clocks and other time sources */
> > +
> > +/*! Save the specified clock */
> > +int64_t replay_save_clock(unsigned int kind, int64_t clock);
> > +/*! Read the specified clock from the log or return cached data */
> > +int64_t replay_read_clock(unsigned int kind);
> > +/*! Saves or reads the clock depending on the current replay mode. */
> > +#define REPLAY_CLOCK(clock, value)                                      \
> > +    (replay_mode == REPLAY_MODE_PLAY ? replay_read_clock((clock))       \
> > +        : replay_mode == REPLAY_MODE_RECORD                             \
> > +            ? replay_save_clock((clock), (value))                       \
> > +        : (value))
> > +
> 
> Inline functions please, not macros.

Macro is required here, because I do not want the "value" to be computed in
replay mode at all.

Pavel Dovgalyuk




reply via email to

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