[Spice-commits] 2 commits - server/red-record-qxl.c server/red-record-qxl.h server/red-worker.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Wed Jun 8 14:28:34 UTC 2016
server/red-record-qxl.c | 6 +++---
server/red-record-qxl.h | 5 +++--
server/red-worker.c | 6 +++---
3 files changed, 9 insertions(+), 8 deletions(-)
New commits:
commit aed25d84077481d9779264d17e88d81b2abababa
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Wed Jun 8 09:56:57 2016 +0100
record: Use spice_get_monotonic_time_ns instead of stat_now(CLOCK_MONOTONIC)
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/server/red-worker.c b/server/red-worker.c
index 121a2e5..c53bc15 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -159,7 +159,7 @@ static int red_process_cursor(RedWorker *worker, int *ring_is_empty)
if (worker->record)
red_record_qxl_command(worker->record, &worker->mem_slots, ext_cmd,
- stat_now(CLOCK_MONOTONIC));
+ spice_get_monotonic_time_ns());
worker->cursor_poll_tries = 0;
switch (ext_cmd.cmd.type) {
@@ -222,7 +222,7 @@ static int red_process_display(RedWorker *worker, int *ring_is_empty)
if (worker->record)
red_record_qxl_command(worker->record, &worker->mem_slots, ext_cmd,
- stat_now(CLOCK_MONOTONIC));
+ spice_get_monotonic_time_ns());
stat_inc_counter(reds, worker->command_counter, 1);
worker->display_poll_tries = 0;
@@ -1186,7 +1186,7 @@ static void worker_dispatcher_record(void *opaque, uint32_t message_type, void *
{
RedWorker *worker = opaque;
- red_record_event(worker->record, 1, message_type, stat_now(CLOCK_MONOTONIC));
+ red_record_event(worker->record, 1, message_type, spice_get_monotonic_time_ns());
}
static void register_callbacks(Dispatcher *dispatcher)
commit cf4b289f29de5b9ff1eefa70a8c53398cf2faf8d
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Wed Jun 8 09:56:30 2016 +0100
record: Use proper type for timestamp
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>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
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-commits
mailing list