函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\time\timekeeping.c Create Date:2022-07-27 11:42:37
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Adjust the timekeeper's multiplier to the correct frequency* and also to reduce the accumulated error value.

函数原型:static void timekeeping_adjust(struct timekeeper *tk, s64 offset)

返回类型:void

参数:

类型参数名称
struct timekeeper *tk
s64offset
1907  如果此条件成立可能性大(为编译器优化)(The ntp_tick_length() value currently being used.* This cached copy ensures we consistently apply the tick* length for an entire tick, as ntp_tick_length may change* mid-tick, and we don't want to apply that new value to* the tick in progress. == Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. )则
1908  mult等于multntp_err_mult
1909  否则
1910  The ntp_tick_length() value currently being used.* This cached copy ensures we consistently apply the tick* length for an entire tick, as ntp_tick_length may change* mid-tick, and we don't want to apply that new value to* the tick in progress.等于Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT.
1911  mult等于div64_u64 - unsigned 64bit divide with 64bit divisor*@dividend: 64bit dividend*@divisor: 64bit divisor* This implementation is a modified version of the algorithm proposed* by the book 'Hacker's Delight'. The original source and full proof
1921  ntp_err_mult等于如果Difference between accumulated time and NTP time in ntp* shifted nano seconds. 大于0则1否则0
1922  mult加等于ntp_err_mult
1924  Apply a multiplier adjustment to the timekeeper
1926  如果此条件成立可能性小(为编译器优化)(maxadj && (abs - return absolute value of an argument*@x: the value. If it is unsigned type, it is converted to signed type first.* char is treated as if it was signed (regardless of whether it really is)* but the macro's return type is preserved as char.(mult - mult) > maxadj))则
1929  Print a one-time message (analogous to WARN_ONCE() et al):(warning conditions "Adjusting %s more than 11%% (%ld vs %ld)\n", name, (long)mult, (long)mult + maxadj)
1945  如果此条件成立可能性小(为编译器优化)((s64)xtime_nsec < 0)则
1946  xtime_nsec加等于NSEC_PER_SEC左移shift
1948  xtime_sec自减
1949  Flag used to avoid updating NTP twice with same second 等于1
调用者
名称描述
timekeeping_advancemekeeping_advance - Updates the timekeeper to the current time and* current NTP tick length