函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\core.c Create Date:2022-07-27 14:53:03
Last Modify:2022-05-20 07:50:19 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:perf_calculate_period

函数原型:static u64 perf_calculate_period(struct perf_event *event, u64 nsec, u64 count)

返回类型:u64

参数:

类型参数名称
struct perf_event *event
u64nsec
u64count
3637  frequency等于sample_freq
3638  sec等于NSEC_PER_SEC
3643  count_fls等于ls64 - find last set bit in a 64-bit word*@x: the word to search* This is defined in a similar way as the libc and compiler builtin* ffsll, but returns the position of the most significant set bit
3644  nsec_fls等于ls64 - find last set bit in a 64-bit word*@x: the word to search* This is defined in a similar way as the libc and compiler builtin* ffsll, but returns the position of the most significant set bit
3645  frequency_fls等于ls64 - find last set bit in a 64-bit word*@x: the word to search* This is defined in a similar way as the libc and compiler builtin* ffsll, but returns the position of the most significant set bit
3646  sec_fls等于30
3677 count_flssec_fls大于64且nsec_flsfrequency_fls大于64循环
3678  Reduce accuracy by one bit such that @a and @b converge* to a similar magnitude.(nsec, frequency)
3679  Reduce accuracy by one bit such that @a and @b converge* to a similar magnitude.(sec, count)
3682  如果count_flssec_fls大于64则
3683  divisor等于nsecfrequency
3685 count_flssec_fls大于64循环
3687  divisor右移等于1位
3690  dividend等于countsec
3691  否则
3692  dividend等于countsec
3694 nsec_flsfrequency_fls大于64循环
3696  dividend右移等于1位
3699  divisor等于nsecfrequency
3702  如果非divisor则返回:dividend
3705  返回: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
调用者
名称描述
perf_adjust_period