[Spice-devel] [PATCH] stats: use CLOCK_THREAD_CPUTIME_ID for cpu statistics

Christophe Fergeau cfergeau at redhat.com
Mon Jan 11 06:18:33 PST 2016


On Fri, Jan 08, 2016 at 11:30:10AM +0000, Frediano Ziglio wrote:
> Avoid to call red_worker_get_clockid. This function returns uninitialized
> value at the timer DisplayChannel is build resulting in setting
> statistics to CLOCK_REALTIME (which is 0) instead to cpu time as expected.

Imo, we should either get rid of worker->clockid altogether and always
use CLOCK_THREAD_CPUTIME_ID, or initialize it to CLOCK_THREAD_CPUTIME_ID
and warn if the pthread_getcpuclockid() call in red_worker_main() sets
it to something different.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20160111/e6454ee9/attachment.sig>


More information about the Spice-devel mailing list