clk debug patches for linux-next, plus scripts that drive clock-measurement based debugging on Qualcomm SoCs. These tools expose hardware clock-measure support through debugfs so that the actual measured rate of a clock can be checked against the rate that’s configured.
Prerequisites
Before you use these tools, make sure you have the following:- A
linux-nextkernel checkout for the target device, with the DebugCCclkdebug patches from thepatches/directory applied, built, and flashed to the target. debugfsmounted on the target device at/sys/kernel/debug.- Root shell access on the target device.
- A POSIX-compliant shell (
sh) available on-target to run the helper scripts located inscripts/.
Apply the kernel patches
- From a
linux-nextcheckout, apply the common patch set followed by the target-specific patch series, in order, usinggit am:- Apply the patches from the
common/directory. - Apply the patches from the corresponding
soc/<target>/directory. For example, for SA8775P:
- Apply the patches from the
- Build the kernel with the patches applied, and flash it to the target device using your standard build and flash procedure.
- Copy the scripts from the
scripts/directory onto the target device.
Measure a clock rate
Run the helper script for your target platform, passing the name of the clock to measure. For example, on SA8775P:<clock_name>must match an entry in the script’s internal list of supported clocks.- The script prints the measured clock rate in Hz.

