On Wed, 4 Jan 2017, Frank Kardel wrote:

I would also suggest a 64 bit fraction like in struct bintime, which we already have and use internally for timekeeping anyway along with the timespec, timeval conversion functions. Thus collecting can be faster as we don't need to make the conversions when collectiing. I deem converting at userlevel the least worry.

For time stamp fetching see "man 9 microtime" or kern/kern_tc.c:{get,}bin{,up}time(). "get"-versions are cheaper, but only updated at hardclock(). The non-get ones are directly related
to the current time counter.

Using bintime as the "native" timestamp representation would require
changes to the in-kernel structures, rather than just those used for
exporting the data to userland.  And if the in-kernel structures are
changed, then we'll have to be able to print them from within the
kernel.

For userland we could just do float- or double-divide to convert the
fraction to printable format; it's not clear how we could print these
values from within the kernel (where we're not allowed to use fp?).



+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+

Reply via email to