[Spice-devel] [server PATCH v2 1/3] replay: learn how to count commands

Frediano Ziglio fziglio at redhat.com
Fri Mar 11 11:00:28 UTC 2016


The patch (and 2/3) are fine.
The only thing I would change is the subject, specifically I
would remove the "learn how" part like

"replay: count commands"
"replay: skip the first N (slow) commands"

Acked-by: Frediano Ziglio <fziglio at redhat.com>

Frediano


> 
> ---
>  server/tests/replay.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/server/tests/replay.c b/server/tests/replay.c
> index f3b670f..0451b9a 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);
>  
> --
> 2.5.0
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
> 


More information about the Spice-devel mailing list