Re: [PATCH v3 08/10] perf/core: Introduce pmu->adjust_period() callback

From: Ravi Bangoria
Date: Wed Jan 08 2025 - 06:17:12 EST


On 18-Dec-24 7:22 PM, Peter Zijlstra wrote:
> On Tue, Dec 10, 2024 at 09:34:47AM +0000, Ravi Bangoria wrote:
>> Many hardware PMUs have constraints about sample period. For ex, minimum
>> supported sample period for IBS Op PMU is 0x90, the sample period must
>> be multiple of 0x10 for IBS Fetch and IBS Op.
>>
>> Add an optional callback adjust_period() to struct PMU to allow PMU
>> specific drivers to adjust sample period calculated by generic code.
>> This will ensure the sample_period value will always be valid and no
>> additional code is required in PMU specific drivers to re-adjust the
>> period.
>
> And not a word about pmu::check_period() and x86_pmu::limit_period() :-(

Let me collate them. Will respin.

Thanks for the feedback,
Ravi