Date: Sat, 02 Jun 2018 06:21:43 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 228669] CLOCK_PROCESS_CPUTIME_ID is unnecessarily inaccurate Message-ID: <bug-228669-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D228669 Bug ID: 228669 Summary: CLOCK_PROCESS_CPUTIME_ID is unnecessarily inaccurate Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: cperciva@FreeBSD.org clock_gettime(CLOCK_PROCESS_CPUTIME_ID) is far less accurate than clock_gettime(CLOCK_PROF), even though it seems that they should theoretica= lly measure the same thing: CLOCK_PROF Increments when the CPU is running in user or kernel mode. CLOCK_PROCESS_CPUTIME_ID Returns the execution time of the calling process. It looks like this is due to CLOCK_PROF (aka. calcru) adding time from the current time slice, while CLOCK_PROCESS_CPUTIME_ID (aka. get_process_cputime aka rufetch) does not. Since CLOCK_PROCESS_CPUTIME_ID is the version mandated by POSIX, it would be nice if it were at least as accurate as the historical BSD profiling clock = ID. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-228669-227>