Re: [PATCH v3 3/4] rteval: cyclictest.py: Sort the list of cpus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Mon, 18 Oct 2021, Punit Agrawal wrote:

> From: Punit Agrawal <punit1.agrawal@xxxxxxxxxxxxx>
> 
> online_cpus() returns a list of online cpus in arbitrary order. e.g.,
> on a hexacore system it returns -
> 
>     ['5', '3', '1', '4', '2', '0']
> 
> Generally this wouldn't be a problem but the cyclictest.py module
> matches the unsorted list with the latencies output by "cyclictest"
> which are ordered by core number. This leads to incorrect reporting of
> per-core latencies in the final report generated by rteval. The issue
> was noticed when comparing the rteval report with cyclictest logs
> (enabled by a recent change).
> 
> Fix the inconsistency in core numbering by sorting the list of cpus
> used by cyclictest.py module. As the cpus are represented as a string,
> sort with the integer key to avoid issues on systems with large number
> of cores.
> 
> Signed-off-by: Punit Agrawal <punit1.agrawal@xxxxxxxxxxxxx>
> ---
>  rteval/modules/measurement/cyclictest.py | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py
> index d3a0b045b9dd..50a734c75047 100644
> --- a/rteval/modules/measurement/cyclictest.py
> +++ b/rteval/modules/measurement/cyclictest.py
> @@ -216,6 +216,10 @@ class Cyclictest(rtevalModulePrototype):
>          else:
>              self.__cpus = online_cpus()
>  
> +        # Sort the list of cpus to align with the order reported by
> +        # cyclictest
> +        self.__cpus.sort(key=int)
> +
>          # Get the cpuset from the environment
>          cpuset = os.sched_getaffinity(0)
>  
> -- 
> 2.33.0
> 
> 
Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux