These are some pointers to timing and timer related files in the Linux kernel.
The
kernel/time/time.c file defines basic time related system calls:
time,
stime,
gettimeofday,
settimeofday, etc.
The
kernel/time/timer.c file implements a legacy timer subsystem based on
timer wheels.
The
kernel/time/hrtimer.c file implements a high resolution timers subsystem that is the
basis for high resolution kernel timers as well as most current userspace timer iterfaces:
itimers, nanosleep, and POSIX timers.
The
kernel/time/tick-common.c file defines functions for generating and handling
tick events, including
tick_periodic and
tick_handle_periodic
for periodic tick systems.
The
kernel/time/tick-oneshot.c file defines functions for oneshot ticks.
The
kernel/time/tick-broadcast.c file defines functions for handling
the broadcast of tick events for SMP systems, including functions for
handling ticks in oneshot mode.
The
include/linux/ktime.h file defines the ktime_t
type, which is a nanosecond representation of kernel time values.
The
kernel/time/timekeeping.c file several functions
for accessing, measuring, and setting time in the Linux kernel,
including several functions which return or take as parameters
variables of the ktime_t type.