summaryrefslogtreecommitdiff
path: root/server/display-channel.c
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2015-12-16 09:41:13 +0000
committerFrediano Ziglio <fziglio@redhat.com>2016-01-11 16:29:08 +0000
commit26c7e33de36cd4e6fe065b70d96705fba8bd3141 (patch)
treedc9a789f76e5b43eab11412a0f7f5c7246a3c417 /server/display-channel.c
parent1b6af4779a3e4063ff0aad7c0a56302eccdc3e08 (diff)
stats: use CLOCK_THREAD_CPUTIME_ID for cpu statistics
Use CLOCK_THREAD_CPUTIME_ID instead of getting the clock with pthread_getcpuclockid. This avoids to call red_worker_get_clockid. This function returns uninitialized value at the time DisplayChannel is built resulting in setting statistics to CLOCK_REALTIME (which is 0) instead to cpu time as expected. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Diffstat (limited to 'server/display-channel.c')
-rw-r--r--server/display-channel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/display-channel.c b/server/display-channel.c
index ec4ca10f..3bf065ca 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -2041,7 +2041,7 @@ DisplayChannel* display_channel_new(RedWorker *worker, int migrate, int stream_v
&cbs, dcc_handle_message);
spice_return_val_if_fail(display, NULL);
- clockid_t stat_clock = red_worker_get_clockid(worker);
+ clockid_t stat_clock = CLOCK_THREAD_CPUTIME_ID;
stat_init(&display->add_stat, "add", stat_clock);
stat_init(&display->exclude_stat, "exclude", stat_clock);
stat_init(&display->__exclude_stat, "__exclude", stat_clock);