[Spice-commits] 2 commits - server/Makefile.am server/dcc-send.c server/main-channel-client.c server/red-channel.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Tue Nov 1 11:39:07 UTC 2016


 server/Makefile.am           |    1 -
 server/dcc-send.c            |    2 +-
 server/main-channel-client.c |    3 +++
 server/red-channel.c         |   11 ++++++-----
 4 files changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 5fba8dd1a346248f215f0167d113fb20a7bb733a
Author: Pavel Grunt <pgrunt at redhat.com>
Date:   Tue Nov 1 12:02:44 2016 +0100

    Do not enable statistic by default
    
    It is more a feature for developers, not force them.
    
    Signed-off-by: Pavel Grunt <pgrunt at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/Makefile.am b/server/Makefile.am
index 2a6010b..0514a2c 100644
--- a/server/Makefile.am
+++ b/server/Makefile.am
@@ -3,7 +3,6 @@ SUBDIRS = . tests
 
 AM_CPPFLAGS =					\
 	-DSPICE_SERVER_INTERNAL			\
-	-DRED_STATISTICS			\
 	$(COMMON_CFLAGS)			\
 	$(GLIB2_CFLAGS)				\
 	$(GOBJECT2_CFLAGS)			\
commit 38b741795f8977c5078bf42181311a97bc4e61a3
Author: Pavel Grunt <pgrunt at redhat.com>
Date:   Tue Nov 1 12:02:43 2016 +0100

    Allow to compile without RED_STATISTICS
    
    Signed-off-by: Pavel Grunt <pgrunt at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/dcc-send.c b/server/dcc-send.c
index 01722c5..5f9ea45 100644
--- a/server/dcc-send.c
+++ b/server/dcc-send.c
@@ -185,7 +185,7 @@ static void red_display_add_image_to_pixmap_cache(RedChannelClient *rcc,
                                                   SpiceImage *image, SpiceImage *io_image,
                                                   int is_lossy)
 {
-    DisplayChannel *display_channel =
+    DisplayChannel *display_channel G_GNUC_UNUSED =
         DISPLAY_CHANNEL(red_channel_client_get_channel(rcc));
     DisplayChannelClient *dcc = DISPLAY_CHANNEL_CLIENT(rcc);
 
diff --git a/server/main-channel-client.c b/server/main-channel-client.c
index 836c50e..f933717 100644
--- a/server/main-channel-client.c
+++ b/server/main-channel-client.c
@@ -161,7 +161,10 @@ static void main_channel_client_set_property(GObject *object,
     }
 }
 
+#ifdef RED_STATISTICS
 static void ping_timer_cb(void *opaque);
+#endif
+
 static void main_channel_client_constructed(GObject *object)
 {
     G_OBJECT_CLASS(main_channel_client_parent_class)->constructed(object);
diff --git a/server/red-channel.c b/server/red-channel.c
index 8f9ae6c..bb896c7 100644
--- a/server/red-channel.c
+++ b/server/red-channel.c
@@ -209,12 +209,14 @@ static void red_channel_client_default_peer_on_error(RedChannelClient *rcc)
 
 static void red_channel_on_output(void *opaque, int n)
 {
-    RedChannelClient *rcc = opaque;
-    RedChannel *self = red_channel_client_get_channel(rcc);
+    RedChannelClient *rcc G_GNUC_UNUSED;
+    RedChannel *self G_GNUC_UNUSED;
 
     red_channel_client_on_output(opaque, n);
-
+#ifdef RED_STATISTICS
+    self = red_channel_client_get_channel((RedChannelClient *)opaque);
     stat_inc_counter(self->priv->reds, self->priv->out_bytes_counter, n);
+#endif
 }
 
 static void
@@ -336,7 +338,6 @@ red_channel_init(RedChannel *self)
 
     red_channel_set_common_cap(self, SPICE_COMMON_CAP_MINI_HEADER);
     self->priv->thread_id = pthread_self();
-    self->priv->out_bytes_counter = 0;
 
     // TODO: send incoming_cb as parameters instead of duplicating?
     self->priv->incoming_cb.on_error =
@@ -436,9 +437,9 @@ int red_channel_is_waiting_for_migrate_data(RedChannel *channel)
 void red_channel_set_stat_node(RedChannel *channel, StatNodeRef stat)
 {
     spice_return_if_fail(channel != NULL);
+#ifdef RED_STATISTICS
     spice_return_if_fail(channel->priv->stat == 0);
 
-#ifdef RED_STATISTICS
     channel->priv->stat = stat;
     channel->priv->out_bytes_counter =
         stat_add_counter(channel->priv->reds, stat, "out_bytes", TRUE);


More information about the Spice-commits mailing list