kernel: time: Compile out NTP support
Add a new EXPERT config option CONFIG_NTP to compile out NTP
functionality. Make config NTP_PPS depend on config NTP.
This new config is useful for saving space in embedded systems
which do not need to synchronize their system clock using NTP.
Replace the declaration of extern functions from
ntp_internal.h with no-op static inline functions.
The NTP accessor functions defined in timekeeping.c are also
compiled out and their declaration from timex.h is changed with
no_op static inline functions.
This patch compiles out the definition of adjtimex and clock_adjtime
syscalls when CONFIG_NTP is set to n. The compat versions of these
two syscalls are also compiled out.
Add sys_adjtimex and sys_clock_adjtime to the list of optional
syscalls.
bloat-o-meter output:
add/remove: 1/35 grow/shrink: 2/6 up/down: 873/-3266 (-2393)
function old new delta
update_wall_time 1320 1978 +658
tk_set_wall_to_mono.constprop - 180 +180
timekeeping_set_tai_offset 54 89 +35
time_status 4 - -4
time_state 4 - -4
time_reftime 4 - -4
time_maxerror 4 - -4
time_esterror 4 - -4
time_constant 4 - -4
time_adjust 4 - -4
tick_usec 4 - -4
tick_nsec 4 - -4
posix_clock_realtime_adj 7 3 -4
timekeeping_update.constprop 234 229 -5
ntp_init 5 - -5
time_offset 8 - -8
time_freq 8 - -8
tick_length_base 8 - -8
tick_length 8 - -8
ntp_tick_adj 8 - -8
do_settimeofday 288 279 -9
__timekeeping_inject_sleeptime.constprop 179 170 -9
sys_adjtimex 10 - -10
timekeeping_init 432 420 -12
__setup_ntp_tick_adj_setup 12 - -12
sys_clock_adjtime 14 - -14
__setup_str_ntp_tick_adj_setup 14 - -14
ntp_tick_length 18 - -18
timekeeping_inject_offset 367 346 -21
ntp_notify_cmos_timer 25 - -25
__timekeeping_set_tai_offset 38 - -38
ntp_tick_adj_setup 42 - -42
sync_cmos_work 52 - -52
SYSC_adjtimex 67 - -67
ntp_clear 85 - -85
SYSC_clock_adjtime 106 - -106
ntp_validate_timex 119 - -119
tk_set_wall_to_mono 148 - -148
ntp_update_frequency 172 - -172
do_adjtimex 179 - -179
sync_cmos_clock 198 - -198
accumulate_nsecs_to_secs.constprop 279 - -279
second_overflow 507 - -507
__do_adjtimex 1040 - -1040
Signed-off-by: Catalina Mocanu <catalina.mocanu@gmail.com>
[josh: Handle CONFIG_COMPAT=y.]
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
10 files changed