Repository navigation
pmdomain: apple: pmp-report: Read CPU idle time without cpufreq - #1612
Closed
DjDeveloperr wants to merge 1 commit into
Closed
DjDeveloperr wants to merge 1 commit into
DjDeveloperr wants to merge 1 commit into
Conversation
The J613 floor samples each CPU's idle time with get_cpu_idle_time(), which cpufreq.h declares only with CONFIG_CPU_FREQ. Without it, as in the arm64 KUnit configs, the call is an implicit declaration and the driver fails to build. Read the two counters that get_cpu_idle_time(cpu, &wall, 0) adds, idle and iowait, from kernel_stat.h, which declares them for every config. The order is the same, so the wall time still comes from the iowait read. Signed-off-by: Diljit Singh <hey@djdev.me>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The J613 floor samples each CPU's idle time with
get_cpu_idle_time(), whichcpufreq.hdeclares only withCONFIG_CPU_FREQ. Builds without it, like the arm64 KUnit config in #1587's kunit job, fail atpmp-report.c:1704with an implicit declaration.This reads the same two counters that
get_cpu_idle_time(cpu, &wall, 0)adds,get_cpu_idle_time_us()and thenget_cpu_iowait_time_us(), fromkernel_stat.h, which declares them for every config. The order is the same, so the wall time still comes from the iowait read, and builds withCPU_FREQ=ybehave as before. One file, no#ifdef.Build check:
drivers/pmdomain/apple/pmp-report.oonly, arm64LLVM=1, config fromdrivers/pmdomain/apple/.kunitconfig.apple-pmp-start(no suites run):CPU_FREQoff: fails with arm64: dts: apple: t6050-j714s: Add the Touch ID sensor (and read its factory seal) #1587's error (call to undeclared function 'get_cpu_idle_time',pmp-report.c:1704);CPU_FREQoff: builds, no warnings;CPU_FREQ=y: builds, no warnings;get_cpu_idle_time_usandget_cpu_iowait_time_us.🤖 Generated with Claude Code