summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2015-12-02 11:31:10 +0000
committerFrediano Ziglio <fziglio@redhat.com>2015-12-03 10:56:03 +0000
commit89707f3b4ddb2d24d4b0882680d833248a30920c (patch)
tree7a4848c53630053edaa9c24ef51a96968ab1df3c /server
parentef8c431d9ba79b943070bf0544a57f24a7b74737 (diff)
stat: fix stat_info_t initialization
For compression statistics clock field was not initialized but used computing statistics. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Diffstat (limited to 'server')
-rw-r--r--server/display-channel.c14
-rw-r--r--server/stat.h5
2 files changed, 10 insertions, 9 deletions
diff --git a/server/display-channel.c b/server/display-channel.c
index e9e3770e..7017b2a3 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -2039,13 +2039,13 @@ DisplayChannel* display_channel_new(RedWorker *worker, int migrate, int stream_v
display->non_cache_counter = stat_add_counter(channel->stat,
"non_cache", TRUE);
#endif
- stat_compress_init(&display->lz_stat, "lz");
- stat_compress_init(&display->glz_stat, "glz");
- stat_compress_init(&display->quic_stat, "quic");
- stat_compress_init(&display->jpeg_stat, "jpeg");
- stat_compress_init(&display->zlib_glz_stat, "zlib");
- stat_compress_init(&display->jpeg_alpha_stat, "jpeg_alpha");
- stat_compress_init(&display->lz4_stat, "lz4");
+ stat_compress_init(&display->lz_stat, "lz", red_worker_get_clockid(worker));
+ stat_compress_init(&display->glz_stat, "glz", red_worker_get_clockid(worker));
+ stat_compress_init(&display->quic_stat, "quic", red_worker_get_clockid(worker));
+ stat_compress_init(&display->jpeg_stat, "jpeg", red_worker_get_clockid(worker));
+ stat_compress_init(&display->zlib_glz_stat, "zlib", red_worker_get_clockid(worker));
+ stat_compress_init(&display->jpeg_alpha_stat, "jpeg_alpha", red_worker_get_clockid(worker));
+ stat_compress_init(&display->lz4_stat, "lz4", red_worker_get_clockid(worker));
display->n_surfaces = n_surfaces;
display->num_renderers = num_renderers;
diff --git a/server/stat.h b/server/stat.h
index 3c980d04..77bfc697 100644
--- a/server/stat.h
+++ b/server/stat.h
@@ -81,9 +81,10 @@ static inline void stat_reset(stat_info_t *info)
}
#ifdef COMPRESS_STAT
-static inline void stat_compress_init(stat_info_t *info, const char *name)
+static inline void stat_compress_init(stat_info_t *info, const char *name, clockid_t clock)
{
info->name = name;
+ info->clock = clock;
stat_reset(info);
}
@@ -107,7 +108,7 @@ static inline double stat_byte_to_mega(uint64_t size)
}
#else
-#define stat_compress_init(a, b)
+#define stat_compress_init(a, b, c)
#define stat_compress_add(a, b, c, d)
#endif