[Spice-devel] [PATCH 1/3] record: Use proper type for timestamp

Jonathon Jongsma jjongsma at redhat.com
Wed Jun 8 14:16:12 UTC 2016


Acked-by: Jonathon Jongsma <jjongsma at redhat.com>


On Wed, 2016-06-08 at 10:20 +0100, Frediano Ziglio wrote:
> Use red_time_t to make sure timestamp has the right precision even
> on 32 bit systems.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-record-qxl.c | 6 +++---
>  server/red-record-qxl.h | 5 +++--
>  2 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/server/red-record-qxl.c b/server/red-record-qxl.c
> index 9b7d2af..d92b5e7 100644
> --- a/server/red-record-qxl.c
> +++ b/server/red-record-qxl.c
> @@ -804,18 +804,18 @@ void red_record_primary_surface_create(RedRecord
> *record,
>          line_0);
>  }
>  
> -void red_record_event(RedRecord *record, int what, uint32_t type, unsigned
> long ts)
> +void red_record_event(RedRecord *record, int what, uint32_t type, red_time_t
> ts)
>  {
>      // TODO: record the size of the packet in the header. This would make
>      // navigating it much faster (well, I can add an index while I'm at it..)
>      // and make it trivial to get a histogram from a file.
>      // But to implement that I would need some temporary buffer for each
> event.
>      // (that can be up to VGA_FRAMEBUFFER large)
> -    fprintf(record->fd, "event %u %d %u %lu\n", record->counter++, what,
> type, ts);
> +    fprintf(record->fd, "event %u %d %u %"PRIu64"\n", record->counter++,
> what, type, ts);
>  }
>  
>  void red_record_qxl_command(RedRecord *record, RedMemSlotInfo *slots,
> -                            QXLCommandExt ext_cmd, unsigned long ts)
> +                            QXLCommandExt ext_cmd, red_time_t ts)
>  {
>      FILE *fd = record->fd;
>  
> diff --git a/server/red-record-qxl.h b/server/red-record-qxl.h
> index ae22de2..7332afe 100644
> --- a/server/red-record-qxl.h
> +++ b/server/red-record-qxl.h
> @@ -23,6 +23,7 @@
>  
>  #include "red-common.h"
>  #include "memslot.h"
> +#include "utils.h"
>  
>  typedef struct RedRecord RedRecord;
>  
> @@ -38,9 +39,9 @@ void red_record_primary_surface_create(RedRecord *record,
>                                         QXLDevSurfaceCreate *surface,
>                                         uint8_t *line_0);
>  
> -void red_record_event(RedRecord *record, int what, uint32_t type, unsigned
> long ts);
> +void red_record_event(RedRecord *record, int what, uint32_t type, red_time_t
> ts);
>  
>  void red_record_qxl_command(RedRecord *record, RedMemSlotInfo *slots,
> -                            QXLCommandExt ext_cmd, unsigned long ts);
> +                            QXLCommandExt ext_cmd, red_time_t ts);
>  
>  #endif


More information about the Spice-devel mailing list