From patchwork Thu Sep 2 09:24:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 506143 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 9A13DC432BE for ; Thu, 2 Sep 2021 09:25:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 718F861058 for ; Thu, 2 Sep 2021 09:25:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245183AbhIBJ0N (ORCPT ); Thu, 2 Sep 2021 05:26:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245064AbhIBJ0M (ORCPT ); Thu, 2 Sep 2021 05:26:12 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09F28C061575 for ; Thu, 2 Sep 2021 02:25:15 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id g184so1293119pgc.6 for ; Thu, 02 Sep 2021 02:25:15 -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=JmCaDM1U0WaT8LSXZ5sOTiK3+wpdfRr4q9T02K3qbKA=; b=Yn73HelmglhJTNvBmgtBmM1cECGTXJVFHgaziVl5Tp8KieEJzekTwJcmOuKviIvXhb 8PYiOXjB0bF55QzrKHsj2yLAtWnBGVJfRv5ODwF9wcJyiG9/igJjmfC98GEWrSEUnPOI jGkS2c3iZ9e23oCMGruBgCsyLU9JpvxlIGEYG8mbNwUC/M+cO+KgpMzlP/qc5s0AkMG9 QBnMUzmdxJWSA8yP2qJEIo61faFAHdG+gFLebR/xS1ndBwxtz4hMJ1tcqtzodDZVxwCV AxLUlVe3KE8GLPzDa29aiEXcqX/YnEf2rq4W7O2LcjS1xtt4ZzF8iXhinPco4wMP5Y2N 2M3A== 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=JmCaDM1U0WaT8LSXZ5sOTiK3+wpdfRr4q9T02K3qbKA=; b=EK16ULbvwHVDifnV9Xb7XVYj8HN8dGJR4kIQ8d21HnyoRkvGZsRPpMlWvPSwGS5QSQ 2Z2iPAnlWL6cATkpTRKmm7T9lA0OR9tUeYIDm980U+6m/+JGSE3yy6vsRs97RqIhDc1V RnvOrbw3LHpp24FOPAhgg26PordWw6iNnJFW4Sftz6XlJeD/o5ibBZz8yYJidv7Kkp8F VQTkujZJMv1NI44jLhx4w2PQFWgvV2CE/WdRpMt48QATohTpKrX5l1etr+YLj/sIHndL 9fuffJ4OvbL2IwPYpaNjf6yEtpo7YLcN0OsaRrifqGspjUvS/vbQ8/xL7rfYBRhZqCf3 O5nw== X-Gm-Message-State: AOAM530YjfnboyKCW9nClsc1B3ox03JSqp0zu/TYAePc8/XJVS1AfbxG 4QtjA79MwV7qWodzZvMJNyQ= X-Google-Smtp-Source: ABdhPJx/L6MUNCN8wm8rpNjrML1kRvxImWltiepnBEDrmYBDpw7wYaCB6bQLlBAb195MrF14ASC6ig== X-Received: by 2002:a05:6a00:1150:b0:40a:78df:8179 with SMTP id b16-20020a056a00115000b0040a78df8179mr2437256pfm.67.1630574714557; Thu, 02 Sep 2021 02:25:14 -0700 (PDT) Received: from localhost (122x211x248x161.ap122.ftth.ucom.ne.jp. [122.211.248.161]) by smtp.gmail.com with ESMTPSA id b20sm1478936pfl.9.2021.09.02.02.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Sep 2021 02:25:14 -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 1/3] rteval: cyclictest.py Enable logging cyclictest output Date: Thu, 2 Sep 2021 18:24:50 +0900 Message-Id: <20210902092452.726905-2-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 The cyclictest.py module uses a temporary file to store the output from "cyclictest" which is deleted at the end of the run. As the collected log contains more information than what is being reported by rteval it would make sense to persist the logs. It can also be useful to sanity check the results reported by rteval. With this goal, create a persistent file named "cyclictest.stdout" (instead of a tempfile) to capture the cyclictest logs. The file is stored in the same location as the logs from the other modules. Signed-off-by: Punit Agrawal --- rteval/modules/measurement/cyclictest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py index b1755d4f4421..0037c3ad07bd 100644 --- a/rteval/modules/measurement/cyclictest.py +++ b/rteval/modules/measurement/cyclictest.py @@ -197,6 +197,7 @@ class Cyclictest(rtevalModulePrototype): self.__numanodes = int(self.__cfg.setdefault('numanodes', 0)) self.__priority = int(self.__cfg.setdefault('priority', 95)) self.__buckets = int(self.__cfg.setdefault('buckets', 2000)) + self.__reportdir = self.__cfg.setdefault('reportdir', os.getcwd()) self.__numcores = 0 self.__cpus = [] self.__cyclicdata = {} @@ -255,6 +256,8 @@ class Cyclictest(rtevalModulePrototype): mounts.close() return ret + def _open_logfile(self, name): + return open(os.path.join(self.__reportdir, "logs", name), 'w+b') def _WorkloadSetup(self): self.__cyclicprocess = None @@ -288,7 +291,7 @@ class Cyclictest(rtevalModulePrototype): self.__cmd.append("--tracemark") # Buffer for cyclictest data written to stdout - self.__cyclicoutput = tempfile.SpooledTemporaryFile(mode='w+b') + self.__cyclicoutput = self._open_logfile('cyclictest.stdout') def _WorkloadTask(self): 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):