Time counters are the lowest level of time tracking in the kernel.
They provide monotonically increasing timestamps with known width and
They can overflow, drift, etc and so in raw form can be used only in very limited
performance-critical places like the process scheduler.
More usable time is created by scaling the values read from the selected
time counter and combining it with some offset, regularly updated by
Different platforms provide different kinds of timer hardware.
The goal of the time counters subsystem is to provide a unified way to access
Each driver implementing time counters registers them with the subsystem.
It is possible to see the list of present time counters, via the
kern.timecounter.choice: TSC-low(-100) HPET(950) i8254(0) ACPI-fast(900) dummy(-1000000)
The output nodes are defined as follows:
| kern.timecounter.tc. X .mask
is a bitmask, defining valid counter bits,
| kern.timecounter.tc. X .counter
is a present counter value,
| kern.timecounter.tc. X .frequency
is a counter update frequency,
| kern.timecounter.tc. X .quality
is an integral value, defining the quality of this time counter
compared to others.
A negative value means this time counter is broken and should not be used.
The time management code of the kernel automatically switches to a
higher-quality time counter when it registers, unless the
sysctl has been used to choose a specific device.
There is no way to unregister a time counter once it has registered
with the kernel.
If a dynamically loaded module contains a time counter you will not
be able to unload that module, even if the time counter it contains
is not the one currently in use.