]> git.ipfire.org Git - thirdparty/linux.git/commit
tools/power turbostat: Harden against unexpected values
authorLen Brown <len.brown@intel.com>
Mon, 8 Dec 2025 15:01:04 +0000 (10:01 -0500)
committerLen Brown <len.brown@intel.com>
Wed, 4 Feb 2026 20:52:11 +0000 (14:52 -0600)
commitd0f7093ad5e4aa37405da2669bca1a62d22b7025
tree888699e30e8d832d5c6a9c834931dcf1b1f6eae9
parent61764831d5b148a9f3afe7ac35089e5908c92a81
tools/power turbostat: Harden against unexpected values

Divide-by-zero resulted if LLC references == 0

Pull the percentage division into pct() to centralize sanity checks there.

Fixes: 8808292799b0 ("tools/power turbostat: Print "nan" for out of range percentages")
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c