Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\aperfmperf.c Create Date:2022-07-28 07:56:35
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:aperfmperf_snapshot_khz()* On the current CPU, snapshot APERF, MPERF, and jiffies* unless we already did it within 10ms* calculate kHz, save snapshot

Proto:static void aperfmperf_snapshot_khz(void *dummy)

Type:void

Parameter:

TypeParameterName
void *dummy
43  s = this_cpu_ptr( & samples)
46  local_irq_save(flags)
47  rdmsrl(MSR_IA32_APERF, aperf)
48  rdmsrl(MSR_IA32_MPERF, mperf)
49  local_irq_restore(flags)
51  aperf_delta = aperf - aperf
52  mperf_delta = mperf - mperf
58  If mperf_delta == 0 Then Return
61  time = ktime_get()
62  aperf = aperf
63  mperf = mperf
64  khz = 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