From patchwork Thu Sep 2 09:24:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 506142 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26BD3C432BE for ; Thu, 2 Sep 2021 09:25:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F303E6108B for ; Thu, 2 Sep 2021 09:25:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245221AbhIBJ0b (ORCPT ); Thu, 2 Sep 2021 05:26:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245222AbhIBJ02 (ORCPT ); Thu, 2 Sep 2021 05:26:28 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEA39C061757 for ; Thu, 2 Sep 2021 02:25:30 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id m17so787772plc.6 for ; Thu, 02 Sep 2021 02:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ou8rdBL69astMxmi4TEgS7vEMJ4yUlxaB1LdNn1ffeM=; b=Sv7bPAfTz7R8Q3i/dBxbJwtrboTD5qNh10gu2SaB+m9eQC6dgd4ZdRxqkmObUh4RP/ lbZ/4j3nhh0mzxT414I8K9c+NQtNNRfR8E2sTkZNNqrMcs1MUmR8uLxySvveNXlhxKxL TySWh791dzUKqMH1XFvQYS210wxrJdAvN+ITDnDnmxTiJnZYf98yM7/6sc7BBxFwO3q9 9TEBzv9J68LahM9UxD7jJz7H+cxsoAQRg63TV6ASeRxIloYvqjBEXLokXn51+DhrjD3C 1fUXuqLugV/0m3yR78jtjC541uPY4yP5pY3j3W0I4C4x5/ng49f2UbcbTqoTAMyuQ+JV P7Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ou8rdBL69astMxmi4TEgS7vEMJ4yUlxaB1LdNn1ffeM=; b=ftrft36ZZ6ilx0ntX6A0e1mjNzw58j3/m69VlZDdY5l5DsLhRkZxm8vADe8SE2JFdG QHF8dUwrXZB76aXNb/R1ZtLY2NQ1ibAXGh4cjzebbXwhko9mPCwtud7XELoFcwLLiYml gwqMQn3JFxpjUEepUf/tMUqhLCm1roUMiAs209cNwuZ2aVX73Yt8bjXf2ul/hS2ltgQ8 +33I3P3oc6ic+Fo9HYU8fdJUWOETPmZggSI0h1jf3sQvKbRahZ9IOS7EoY5OHUsV3OLR ec/BfjhmLnGXldIOmbyqOgjX4neSkfEqRr9DQRfwuO8u1gVMJZakdMpPGFy32P0KS2Kb lPHQ== X-Gm-Message-State: AOAM5303GnoBsb4sUB4mpF4KG2CKdXQvMTIuvmfid6m8e4zLtl+cU9ht x8YcbHbHLwmPKkdMYCumEos= X-Google-Smtp-Source: ABdhPJzPurg4V/IbZruJ8/j4DGwlmAtFaMfzOA9OHM/KqATfL/8gf/X4zm2ysDj+6UOODJxW/m5z7Q== X-Received: by 2002:a17:90b:513:: with SMTP id r19mr2769404pjz.93.1630574730347; Thu, 02 Sep 2021 02:25:30 -0700 (PDT) Received: from localhost (122x211x248x161.ap122.ftth.ucom.ne.jp. [122.211.248.161]) by smtp.gmail.com with ESMTPSA id z17sm1641559pfa.125.2021.09.02.02.25.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 02:25:29 -0700 (PDT) From: Punit Agrawal To: jkacur@redhat.com Cc: Punit Agrawal , linux-rt-users@vger.kernel.org, punit1.agrawal@toshiba.co.jp, Venkata.Pyla@toshiba-tsip.com, dinesh.kumar@toshiba-tsip.com Subject: [PATCH 3/3] rteval: misc.py: Sort the list of cpus returned by online_cpus() Date: Thu, 2 Sep 2021 18:24:52 +0900 Message-Id: <20210902092452.726905-4-punitagrawal@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210902092452.726905-1-punitagrawal@gmail.com> References: <20210902092452.726905-1-punitagrawal@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org From: Punit Agrawal 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 returned by online_cpus(). 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 --- rteval/misc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rteval/misc.py b/rteval/misc.py index 0dd361ff19fd..ec3641e4a013 100644 --- a/rteval/misc.py +++ b/rteval/misc.py @@ -53,6 +53,7 @@ def online_cpus(): for c in glob.glob('/sys/devices/system/cpu/cpu[0-9]*'): num = str(c.replace('/sys/devices/system/cpu/cpu', '')) online_cpus.append(num) + online_cpus.sort(key=int) return online_cpus def invert_cpulist(cpulist):