aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/flamegraph.py
diff options
context:
space:
mode:
authorAdrian Hunter <[email protected]>2024-03-25 08:40:21 +0200
committerThomas Gleixner <[email protected]>2024-04-08 15:03:08 +0200
commitfcf190c369149c3b04539797cedf28741eb14164 (patch)
tree9a2860f6c895ca93b5247686cd47b0617f778f2c /tools/perf/scripts/python/flamegraph.py
parente809a80aa0bcf802f99407c23fd6be6fd4eb250a (diff)
timekeeping: Make delta calculation overflow safe
Kernel timekeeping is designed to keep the change in cycles (since the last timer interrupt) below max_cycles, which prevents multiplication overflow when converting cycles to nanoseconds. However, if timer interrupts stop, the calculation will eventually overflow. Add protection against that. In timekeeping_cycles_to_ns() calculation, check against max_cycles, falling back to a slower higher precision calculation. In timekeeping_forward_now(), process delta in chunks of at most max_cycles. Suggested-by: Thomas Gleixner <[email protected]> Signed-off-by: Adrian Hunter <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions