[Spice-commits] 2 commits - server/tests
Frediano Ziglio
fziglio at kemper.freedesktop.org
Wed Mar 16 10:09:35 UTC 2016
server/tests/replay.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
New commits:
commit 2480eb6979fc3183dd41f79bbf05cb4a587eee5f
Author: Uri Lublin <uril at redhat.com>
Date: Sun Mar 6 14:25:06 2016 +0200
replay: skip the first N (slow) commands
Note that the commands are executed by spice-server.
The "skip" is only done on the "sleep" part of the
"slow" command-line option.
This is helpful to run quickly through uninsteresting commands
in a beginning of a recorded file and going slowly when
interesting parts appear
Acked-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/server/tests/replay.c b/server/tests/replay.c
index 1f0c87b..7e4659b 100644
--- a/server/tests/replay.c
+++ b/server/tests/replay.c
@@ -47,6 +47,7 @@ static QXLWorker *qxl_worker = NULL;
static gboolean started = FALSE;
static QXLInstance display_sin = { 0, };
static gint slow = 0;
+static gint skip = 0;
static gboolean print_count = FALSE;
static guint ncommands = 0;
static pid_t client_pid;
@@ -121,8 +122,9 @@ static gboolean fill_queue_idle(gpointer user_data)
++ncommands;
- if (slow)
+ if (slow && (ncommands > skip)) {
g_usleep(slow);
+ }
wakeup = TRUE;
g_async_queue_push(aqueue, cmd);
@@ -301,6 +303,7 @@ int main(int argc, char **argv)
{ "port", 'p', 0, G_OPTION_ARG_INT, &port, "Server port (default 5000)", "PORT" },
{ "wait", 'w', 0, G_OPTION_ARG_NONE, &wait, "Wait for client", NULL },
{ "slow", 's', 0, G_OPTION_ARG_INT, &slow, "Slow down replay. Delays USEC microseconds before each command", "USEC" },
+ { "skip", 0, 0, G_OPTION_ARG_INT, &skip, "skip 'slow' for the first n commands", NULL },
{ "count", 0, 0, G_OPTION_ARG_NONE, &print_count, "Print the number of commands processed", NULL },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &file, "replay file", "FILE" },
{ NULL }
commit 07cb94d7abbf7316304eac5b6f83622a67cec400
Author: Uri Lublin <uril at redhat.com>
Date: Sun Mar 6 14:25:05 2016 +0200
replay: count commands
Acked-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/server/tests/replay.c b/server/tests/replay.c
index 91bcf2b..1f0c87b 100644
--- a/server/tests/replay.c
+++ b/server/tests/replay.c
@@ -47,6 +47,8 @@ static QXLWorker *qxl_worker = NULL;
static gboolean started = FALSE;
static QXLInstance display_sin = { 0, };
static gint slow = 0;
+static gboolean print_count = FALSE;
+static guint ncommands = 0;
static pid_t client_pid;
static GMainLoop *loop = NULL;
static GAsyncQueue *aqueue = NULL;
@@ -117,6 +119,8 @@ static gboolean fill_queue_idle(gpointer user_data)
goto end;
}
+ ++ncommands;
+
if (slow)
g_usleep(slow);
@@ -297,6 +301,7 @@ int main(int argc, char **argv)
{ "port", 'p', 0, G_OPTION_ARG_INT, &port, "Server port (default 5000)", "PORT" },
{ "wait", 'w', 0, G_OPTION_ARG_NONE, &wait, "Wait for client", NULL },
{ "slow", 's', 0, G_OPTION_ARG_INT, &slow, "Slow down replay. Delays USEC microseconds before each command", "USEC" },
+ { "count", 0, 0, G_OPTION_ARG_NONE, &print_count, "Print the number of commands processed", NULL },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &file, "replay file", "FILE" },
{ NULL }
};
@@ -402,6 +407,9 @@ int main(int argc, char **argv)
loop = g_main_loop_new(basic_event_loop_get_context(), FALSE);
g_main_loop_run(loop);
+ if (print_count)
+ g_print("Counted %d commands\n", ncommands);
+
end_replay();
g_async_queue_unref(aqueue);
More information about the Spice-commits
mailing list