diff options
author | Peter Zijlstra <[email protected]> | 2020-07-16 13:11:26 +0800 |
---|---|---|
committer | Will Deacon <[email protected]> | 2020-07-20 11:50:47 +0100 |
commit | 950b74ddefc4a42add8b1ae0170aa309338ffe73 (patch) | |
tree | 3b91c41219f8da64f6eff9b1b74979d0b37cdcbf /scripts/gcc-plugins/cyc_complexity_plugin.c | |
parent | aadd6e5caaacd6feca9691ba30536e7de5a7d152 (diff) |
arm64: perf: Implement correct cap_user_time
As reported by Leo; the existing implementation is broken when the
clock and counter don't intersect at 0.
Use the sched_clock's struct clock_read_data information to correctly
implement cap_user_time and cap_user_time_zero.
Note that the ARM64 counter is architecturally only guaranteed to be
56bit wide (implementations are allowed to be wider) and the existing
perf ABI cannot deal with wrap-around.
This implementation should also be faster than the old; seeing how we
don't need to recompute mult and shift all the time.
[leoyan: Use mul_u64_u32_shr() to convert cyc to ns to avoid overflow]
Reported-by: Leo Yan <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Signed-off-by: Leo Yan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected]>
Diffstat (limited to 'scripts/gcc-plugins/cyc_complexity_plugin.c')
0 files changed, 0 insertions, 0 deletions