Re: [RFC 4/4] perf sched schedstat: Add support for report subcommand

From: Ravi Bangoria
Date: Sun May 12 2024 - 23:13:59 EST


On 11-May-24 1:15 PM, Chen Yu wrote:
> On 2024-05-08 at 11:34:27 +0530, Ravi Bangoria wrote:
>> From: Swapnil Sapkal <swapnil.sapkal@xxxxxxx>
>>
>> `perf sched schedstat record` captures two sets of samples. For workload
>> profile, first set right before workload starts and second set after
>> workload finishes. For the systemwide profile, first set at the beginning
>> of profile and second set on receiving SIGINT signal.
>>
>> Add `perf sched schedstat report` subcommand that will read both the set
>> of samples, get the diff and render a final report. Final report prints
>> scheduler stat at cpu granularity as well as sched domain granularity.
>>
>> Usage example:
>>
>> # perf sched schedstat record
>> # perf sched schedstat report
>>
>> Co-developed-by: Ravi Bangoria <ravi.bangoria@xxxxxxx>
>> Signed-off-by: Swapnil Sapkal <swapnil.sapkal@xxxxxxx>
>> Signed-off-by: Ravi Bangoria <ravi.bangoria@xxxxxxx>
>>
>
> I've tested it on a 240 CPUs Xeon system and it looks very useful. Thanks!

Glad you found it useful!

> 1. Just to confirm, if we want to add new fields for debugging purpose,
> schedstat-domain-v1x.h and schedstat-cpu-v1x.h are the only files to
> be touched, right?

Correct.

> 2. Although we can filter the output, is it applicable to only track some
> CPUs? Like perf sched schedstat -C 4 record

Yes, adding filtering capabilities should be possible at both record and report
time.

Thanks,
Ravi