From patchwork Fri Nov 11 19:53:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 624709 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07B4EC4332F for ; Fri, 11 Nov 2022 19:53:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233437AbiKKTxh (ORCPT ); Fri, 11 Nov 2022 14:53:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232918AbiKKTxg (ORCPT ); Fri, 11 Nov 2022 14:53:36 -0500 Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62A3E2D7 for ; Fri, 11 Nov 2022 11:53:35 -0800 (PST) Received: by mail-qt1-x834.google.com with SMTP id e15so3274690qts.1 for ; Fri, 11 Nov 2022 11:53:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=PFhY1mbdwozhDA+cmgvRco1GaP64Zi7cV1ytk4G1F2Y=; b=VedKw04i1a0S08yD6FrcxNRArqdr2LnCGdPiwUmYIjYJUILJ/OpaHTWD5sTeB4orra Tn+zYkKrnBvJ1uNYXJAiMsC/tku8ipldj4YGgLHaF8TXRPEAwX9+yVum5dX/0uM2HzC+ 8Ib9sKiXHib6WMfNc843pHP+TKqnr/ygXQZBNe0ruUJDYOKBNIyjEy6XwMrWJ3cxnpsh stztyBqM0L2NjSitnCAnIMthX/1H+oT0d0Kr+tVm6PMimICoaZbfqf2KQnCdsGcR0DXV YKUth4flWiHT6tNCeb3FCHp3siodc7NwNBU5sqTRi/epvdFN7tk7bCKrmdxaHQvxn/tt YGiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PFhY1mbdwozhDA+cmgvRco1GaP64Zi7cV1ytk4G1F2Y=; b=cgq5Cejz9BPiukZYfCEGDq1vGZE5HNMVOw2ITlDbPCER+zOUMjYQdupozujvzkGVwa SicRdrGaaOAexiump5XFzLKNIC9oWZb2WZSM5dYE7L3VSUbWCHCyOaw+rkG1Rl8SqF1U iGgr4qQT+TlHHapWKL9E9+gn3byJiow1T8MZSwscTGbA4sChVMBTEsanYmAV65NjGg83 X+iLM8ta1rml2VK0Kti8+NBDwS9kjn+rAfIDL+pTLfrXzXEcXuzCFX6geKz/cUdNlmDg hdJdvFnvB+xUWo+Ntjz3LSPWhBn/v1tnCDoEpYWb/KTfh3N21MgeZPPYxRTzq3RO8eAP ZLWQ== X-Gm-Message-State: ANoB5pliYaV+EXsq35xc+itdgi2l2mRWxWWGG+d1vvLE51BlG/HlYlQP KQtkBqL51ZNMNzGqXYVcj+WslAqXR9c= X-Google-Smtp-Source: AA0mqf7QO6yyIMVsF/kzPmwGmThjd13OsyC9UfzDBX2jLsy/14OnySGkYREM22RGM4nte6G+NOZT/w== X-Received: by 2002:a05:622a:4806:b0:3a4:f140:f707 with SMTP id fb6-20020a05622a480600b003a4f140f707mr2812746qtb.317.1668196413874; Fri, 11 Nov 2022 11:53:33 -0800 (PST) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-08-184-147-142-10.dsl.bell.ca. [184.147.142.10]) by smtp.gmail.com with ESMTPSA id i17-20020ac85c11000000b00397e97baa96sm1794332qti.0.2022.11.11.11.53.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 11:53:32 -0800 (PST) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , Leah Leshchinsky , John Kacur Subject: [PATCH 1/8] rt-tests: Remove arbitrary num of threads limits Date: Fri, 11 Nov 2022 14:53:16 -0500 Message-Id: <20221111195323.27402-1-jkacur@redhat.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Remove the arbitrary limit to the number of threads in pmqtest, ptsematest, sigwaittest and svsematest. Signed-off-by: John Kacur --- src/pmqtest/pmqtest.c | 2 +- src/ptsematest/ptsematest.c | 2 +- src/sigwaittest/sigwaittest.c | 2 +- src/svsematest/svsematest.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c index 6ad0a92ffb5c..9e142787d8b4 100644 --- a/src/pmqtest/pmqtest.c +++ b/src/pmqtest/pmqtest.c @@ -393,7 +393,7 @@ static void process_options(int argc, char *argv[]) } } - if (num_threads < 0 || num_threads > 255) + if (num_threads < 0) error = 1; if (priority < 0 || priority > 99) diff --git a/src/ptsematest/ptsematest.c b/src/ptsematest/ptsematest.c index e000c3017081..a9d6c69b6449 100644 --- a/src/ptsematest/ptsematest.c +++ b/src/ptsematest/ptsematest.c @@ -299,7 +299,7 @@ static void process_options(int argc, char *argv[]) } } - if (num_threads < 0 || num_threads > 255) + if (num_threads < 0) error = 1; if (priority < 0 || priority > 99) diff --git a/src/sigwaittest/sigwaittest.c b/src/sigwaittest/sigwaittest.c index d0d79df940de..728176a0b385 100644 --- a/src/sigwaittest/sigwaittest.c +++ b/src/sigwaittest/sigwaittest.c @@ -369,7 +369,7 @@ static void process_options(int argc, char *argv[]) if (duration < 0) error = 1; - if (num_threads < 1 || num_threads > 255) + if (num_threads < 1) error = 1; if (priority < 0 || priority > 99) diff --git a/src/svsematest/svsematest.c b/src/svsematest/svsematest.c index 22ea7bcb7374..243b13738b19 100644 --- a/src/svsematest/svsematest.c +++ b/src/svsematest/svsematest.c @@ -398,7 +398,7 @@ static void process_options(int argc, char *argv[]) if (duration < 0) error = 0; - if (num_threads < 1 || num_threads > 255) + if (num_threads < 1) error = 1; if (priority < 0 || priority > 99) From patchwork Fri Nov 11 19:53:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 624156 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2173CC433FE for ; Fri, 11 Nov 2022 19:53:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233962AbiKKTxj (ORCPT ); Fri, 11 Nov 2022 14:53:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232918AbiKKTxi (ORCPT ); Fri, 11 Nov 2022 14:53:38 -0500 Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com [IPv6:2607:f8b0:4864:20::f2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 544642D7 for ; Fri, 11 Nov 2022 11:53:37 -0800 (PST) Received: by mail-qv1-xf2f.google.com with SMTP id w10so3978710qvr.3 for ; Fri, 11 Nov 2022 11:53:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=WfV/K5pbb8srIg1oakB2Utgm5TSb7xbJxb2URWVUAJE=; b=psCbl0SL/TAppVROWehhPQTORsXop99iBSe60HNcT8uVYOcM8GLhMzgY/bJO0HTlsj MWryiQ+OvUn4ysxLQXs5G4V/1w6FreqCH3+Suzac4Nhm+xomOsk8IEB9lZkXWN5iIDC8 +4kLxBdNPVGasxILPBTrpoIudcREtcUFwbebU6fyZzTzl6HrFqeH/m0UOQ7c6r/TEqZT dXeBBZt4cGftlwrvYjJ57LKNIMOfzX6VVTeQJoxQdw5NQDtRtD0eo5YKlHD09cgOnBbP uKNZ04NvWCdrIGtfUxOBaVLpVgmK/vRlpiOQwum++qI8ZzTTGIZocS1BvmoAjBkqi71W 09Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=WfV/K5pbb8srIg1oakB2Utgm5TSb7xbJxb2URWVUAJE=; b=FpHOWTp9Go8bpo3FRAbD428xR86OExclB2x+GlU6iHm0cJm44b0lv1Wi85Rtl/bC6S r5bM9c3tpoLYUWwPkSKHepffagajUWm2lb2DRbKYm1DlM4/rv89t84M+VUlbYt0hT/at rAy6X/QVlCmUHUZBDrsj6+VpbZ+oHQ8CnhnszpRxhZbxzyOjdSkY2JAcXMpoihgQpM65 TUSUOC61FPul8lrjNDDFg2eYiTewIMs1yeyY3r2u8l5da34lj3a7OX8sxngT+EzRp+xm Gi9w3Ctpbv7kgUwcLBlUf92L550hzmJceODV3/2lzhGoj52L/Mmpo7aXKH3ZScoJzoNY 1MfA== X-Gm-Message-State: ANoB5plwCj/TiZPTZaVh7+hZ1PNXriBFnAZHmGvR2hFTl8aQypp/vvV+ JMuRYkfugcLIEkAhdDklOptMzbROsxI= X-Google-Smtp-Source: AA0mqf4qd79VC4DyUdcK9CjUScQGjrw4p4Et2RU0CyRSQml28F/mdgZ19phKvBmfpLU9do6t2h4RyA== X-Received: by 2002:a05:6214:5445:b0:4bb:d324:3b0 with SMTP id kz5-20020a056214544500b004bbd32403b0mr3405354qvb.14.1668196415658; Fri, 11 Nov 2022 11:53:35 -0800 (PST) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-08-184-147-142-10.dsl.bell.ca. [184.147.142.10]) by smtp.gmail.com with ESMTPSA id i17-20020ac85c11000000b00397e97baa96sm1794332qti.0.2022.11.11.11.53.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 11:53:34 -0800 (PST) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , Leah Leshchinsky , John Kacur Subject: [PATCH 2/8] rt-tests: hackbench: Add error checking to connect and getsockname Date: Fri, 11 Nov 2022 14:53:17 -0500 Message-Id: <20221111195323.27402-2-jkacur@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111195323.27402-1-jkacur@redhat.com> References: <20221111195323.27402-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Add error checking around the calls connect and getsockname Signed-off-by: John Kacur --- src/hackbench/hackbench.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c index 18c928480103..8c6d83520e57 100644 --- a/src/hackbench/hackbench.c +++ b/src/hackbench/hackbench.c @@ -130,14 +130,16 @@ static int inet_socketpair(int fds[2]) if (bind(s1, &sin, len) < 0) barf("bind"); - getsockname(s1, &sin, &len); + if (getsockname(s1, &sin, &len) < 0) + barf("getsockname"); if (listen(s1, 10) < 0) barf("listen"); if (ioctl(s2, FIONBIO, &ul) < 0) barf("ioctl"); if (ioctl(s1, FIONBIO, &ul) < 0) barf("ioctl"); - connect(s2, &sin, len); + if (connect(s2, &sin, len) < 0) + barf("connect"); if ((fds[0] = accept(s1, &sin, &len)) < 0) barf("accept"); ul = 0; From patchwork Fri Nov 11 19:53:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 624708 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0331EC4332F for ; Fri, 11 Nov 2022 19:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234063AbiKKTxl (ORCPT ); Fri, 11 Nov 2022 14:53:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234005AbiKKTxj (ORCPT ); Fri, 11 Nov 2022 14:53:39 -0500 Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 061972D7 for ; Fri, 11 Nov 2022 11:53:39 -0800 (PST) Received: by mail-qv1-xf2e.google.com with SMTP id x15so3991452qvp.1 for ; Fri, 11 Nov 2022 11:53:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=h0i1/G2Eeh0NKc0FvdpQoeYirSJMXWFtZW80hlb2MUw=; b=eayflIrakiM/5lneoWqspH/vx1S7r+SHJGNlXz5V6edyC4mfbpx4rdHHK0pWvIXH7v PzVeUcZPs4R1koZCtwWXu9lRQ/h6SN+zBab5PNKgUsWbW5VkOWpBherISKRumme3dyyb AWDlrCqn+Go7R0X30EFXkod0Otcbxl0Pljx4U10xw6ftv6E40DylCkhmao64Ddl7NY0e WykSSfijHcA7SIYDvOP3Ep2O3UAI2Eub5DP68X/74rsoBMOr46ZHrrhYb56eOBvgwgM0 VL9VyY4EZTAvLxhK/d506xarKFErLuWYgla8fUeee8cNqCKUeoU4V2CUh/QsGMCAbH6N PeCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=h0i1/G2Eeh0NKc0FvdpQoeYirSJMXWFtZW80hlb2MUw=; b=VlhJSqm5arD5VxFT+Gqo+BZtTE6tNcbcZBQBlldYt2ghHW+3xN2g6NJHdgEwdhJa2v W5iYY/4sLaE8ik67QNvBo9PyfORv3Z8z1MbiX6XUt2t8dQg5tv+oibDwocwEzaLDmj3C 5k0ygKE8sg7JHonhM5ZLa83IhMUYAlEE4BsVJU+Ow6i6QrQhn5tO+pTPK3hBJ/Ww+aV5 AQTYNsu5xlfgI7En/5Cf+DkaMpUm7DDLH03PNAjS4PhGuJLZ7AgEclWDPLtPN9xMXnp5 tYGxSMSTO/h2JxXbTxS8TXIkrOSVm/qVMlYUPUfNoVJwfQoaVAWx7M/kLpZLFioUR8FZ JWmg== X-Gm-Message-State: ANoB5pnvC1Bvs5Y/JebskxpZyv2FNODU9cvrTzZJJWwfVKz/BkEkKp8f rNgHTCzI6FtDtckacFkaJLWEVh0nLxI= X-Google-Smtp-Source: AA0mqf7LNfzFG8eurXuMoDFtStAocjd7u7rCjrZdM2mXHq+4VQoHJjgSIP/7ukS9+MDlGvbtMfW3uQ== X-Received: by 2002:a0c:904b:0:b0:4bc:16b3:6a85 with SMTP id o69-20020a0c904b000000b004bc16b36a85mr3206680qvo.129.1668196417463; Fri, 11 Nov 2022 11:53:37 -0800 (PST) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-08-184-147-142-10.dsl.bell.ca. [184.147.142.10]) by smtp.gmail.com with ESMTPSA id i17-20020ac85c11000000b00397e97baa96sm1794332qti.0.2022.11.11.11.53.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 11:53:36 -0800 (PST) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , Leah Leshchinsky , John Kacur Subject: [PATCH 3/8] rt-tests: hackbench: Fix compile comparison of different signed ints Date: Fri, 11 Nov 2022 14:53:18 -0500 Message-Id: <20221111195323.27402-3-jkacur@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111195323.27402-1-jkacur@redhat.com> References: <20221111195323.27402-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Fix compile warnings about comparisons of integers of different signedness. Signed-off-by: John Kacur --- src/hackbench/hackbench.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c index 8c6d83520e57..dda7690b79a0 100644 --- a/src/hackbench/hackbench.c +++ b/src/hackbench/hackbench.c @@ -200,7 +200,8 @@ static void *sender(struct sender_context *ctx) /* Now pump to every receiver. */ for (i = 0; i < loops; i++) { for (j = 0; j < ctx->num_fds; j++) { - int ret, done = 0; + int ret; + size_t done = 0; again: ret = write(ctx->out_fds[j], data + done, sizeof(data)-done); @@ -231,7 +232,8 @@ static void *receiver(struct receiver_context* ctx) /* Receive them all */ for (i = 0; i < ctx->num_packets; i++) { char data[datasize]; - int ret, done = 0; + int ret; + size_t done = 0; again: ret = read(ctx->in_fds[0], data + done, datasize - done); @@ -289,7 +291,7 @@ static int create_worker(childinfo_t *child, void *ctx, void *(*func)(void *)) void signal_workers(childinfo_t *children, unsigned int num_children) { - int i; + unsigned int i; printf("signaling %d worker threads to terminate\n", num_children); for (i=0; i < num_children; i++) { kill(children[i].pid, SIGTERM); @@ -517,7 +519,7 @@ int main(int argc, char *argv[]) if (setjmp(jmpbuf) == 0) { total_children = 0; for (i = 0; i < num_groups; i++) { - int c = group(child_tab, total_children, num_fds, readyfds[1], wakefds[0]); + unsigned int c = group(child_tab, total_children, num_fds, readyfds[1], wakefds[0]); if( c != (num_fds*2) ) { fprintf(stderr, "%i children started. Expected %i\n", c, num_fds*2); reap_workers(child_tab, total_children + c, 1); From patchwork Fri Nov 11 19:53:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 624155 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78885C4332F for ; Fri, 11 Nov 2022 19:53:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234293AbiKKTxn (ORCPT ); Fri, 11 Nov 2022 14:53:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234005AbiKKTxl (ORCPT ); Fri, 11 Nov 2022 14:53:41 -0500 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D93E317E0D for ; Fri, 11 Nov 2022 11:53:40 -0800 (PST) Received: by mail-qk1-x736.google.com with SMTP id 8so3613439qka.1 for ; Fri, 11 Nov 2022 11:53:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=l55w9Fc5LSZrTMC1IANBZ3n08WMrT2Fhk7XPfCBQ+6U=; b=Eykk8Im1DivowC+YWv1i6LYqr476EDZCUet65mFnNCkwklHzOE/UdN9ou2rASeBS8M 26v203vwdlhx/SgJCTIAWfuh3X+PR6pkF/2I3vboF67PcUngQjCwgqv12+NwbTFqF0dt tmjF1MgGYZR2DzTOxNkpJMIu8b1PbKEGBGKwE7GVL6+V0MnscMH4ybirD0swx8BmLkmd E3xHp8V6cc8md4rRk/NO0eQBMlqjgNdMpiwIaj2uSg1ZvkpFqEKrsPLnDzeGols7WPfS 4qYkFPuu8ePtZh48p5AJB7TU36PQTo3K9ajks51o7rRbQp+Hjdh8/0ujHwdS0B9W/Unf yPgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=l55w9Fc5LSZrTMC1IANBZ3n08WMrT2Fhk7XPfCBQ+6U=; b=6appegFCd2y17dWKsSEAaGLWEVBXN/n5bpOQui5jxaRF2x8sN9LT/9AGcXmPpMEeCi Il/2ZVcnGbH4WsFK65w2YF+AnyJQuELZA1cZplgREi9vhY0Yb4wg/t0yFXQKDNzfrHA4 iAWELqVQn6tVzYl/f7bcoN72FWYy0S0vVPdbFFEc3NJbH2xgq3FQNYI44U6+CmMc1nk7 wBIq8grr73QiKgF5fHRQBD2g/jFI1I9JNTclEX+ywrKjfG5EdtOdeVvMkP0KyZ1hpm4D 2WUHD1qLLQafjxRpv843Vs1HvpmUcTixvfGCfsN8HrhYNK4+Q5JVudB90Z/QxkLIjjE6 Yluw== X-Gm-Message-State: ANoB5pn+fbC9dO2488KytiHjuIVf6oQYbh3nFhJCxZHEWNr/CFJd50HX Xq8Wv92HSXW1nxUmPTFHE/A7eFub4fk= X-Google-Smtp-Source: AA0mqf7s/FdmPyYgOd/4sGi5cp1l18tYv46i0/Xm3D0y1EnuqwTmICtuXe2OWTpL3CjLN+fnKz61Ig== X-Received: by 2002:a37:a95:0:b0:6fa:56bd:eb3f with SMTP id 143-20020a370a95000000b006fa56bdeb3fmr2495360qkk.529.1668196419203; Fri, 11 Nov 2022 11:53:39 -0800 (PST) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-08-184-147-142-10.dsl.bell.ca. [184.147.142.10]) by smtp.gmail.com with ESMTPSA id i17-20020ac85c11000000b00397e97baa96sm1794332qti.0.2022.11.11.11.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 11:53:38 -0800 (PST) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , Leah Leshchinsky , John Kacur Subject: [PATCH 4/8] rt-tests: hackbench: Fix compile warning about fall through Date: Fri, 11 Nov 2022 14:53:19 -0500 Message-Id: <20221111195323.27402-4-jkacur@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111195323.27402-1-jkacur@redhat.com> References: <20221111195323.27402-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org print_usage_exit(0) never returns, but the compiler doesn't understand this. In any case it is not harmful to add a break after this statement. Do so to keep the unhelpful compiler warning from triggering. Signed-off-by: John Kacur --- src/hackbench/hackbench.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c index dda7690b79a0..69dd5f087fb6 100644 --- a/src/hackbench/hackbench.c +++ b/src/hackbench/hackbench.c @@ -444,6 +444,7 @@ static void process_options(int argc, char *argv[]) break; case 'h': print_usage_exit(0); + break; case 'l': if (!(argv[optind] && (loops = atoi(optarg)) > 0)) { fprintf(stderr, "%s: --loops|-l requires an integer > 0\n", argv[0]); From patchwork Fri Nov 11 19:53:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 624707 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C63F1C433FE for ; Fri, 11 Nov 2022 19:53:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234005AbiKKTxq (ORCPT ); Fri, 11 Nov 2022 14:53:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234292AbiKKTxn (ORCPT ); Fri, 11 Nov 2022 14:53:43 -0500 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3D6A1AD84 for ; Fri, 11 Nov 2022 11:53:42 -0800 (PST) Received: by mail-qt1-x82e.google.com with SMTP id h21so3267962qtu.2 for ; Fri, 11 Nov 2022 11:53:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=n+hX2NAHggjCz0cUHEdgD/rldk9/dQ+FtNXtmxsK8nE=; b=BWxPK8xno9WbXuo1YDoGmq30d0LtI2SOzsLy7BrHBzCz9O9AqI3PNtWGNJbn4+yInE Ykc9DfHg5TyxQL3HtgiSSkWMFjLZN8MQvkwnzKITpS8M9YNoPDIDNZqKRhhAzcxWG4Da m8o5aMKHkZcnd0WNOsjms93Gfkx8fW9ipzE+t0TnfOzUNOqdUsCNY1r5mXsyuSxYnLwU Yn9FunbRugYY8JMDyJgFFvAMNqTA+36UQ7DaVn2LkWiMaptgEQrgycVR5qdYOJY4BoHu xy6NXnIflZxvml73UL0fsIuNX/KXGuVOz3QLVpvBzV598Iz3xQ222o5tvFLwO4G6Lx58 alJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=n+hX2NAHggjCz0cUHEdgD/rldk9/dQ+FtNXtmxsK8nE=; b=xvhVU2eLeFeFrjg1+EJrVDZAAimPDl2FCL7z/IG1H3s73X9W1PW0pzLh4Es9H9+3wa 5tTWYocyDcNnUvrqXHC37LJCL4IJ1UGuWAMkuBeU2ZdiLHuNDAjIrDlZBKfACndTbu3Y HN3Qd8Epzgh66cdavDiXogoUTNy8OcIXHTFTGgv2vTwLguXvZYAjXu1I2wD6RaVwnXDG OWewh5mlZ/OalHavzilvJMG616BmkCrsPb62WjXguOV+oQSU3xQ3U3ajiy4Ms/MMuC6s 0tCJq4W2dY3qQEZMCcoS7Y7M+zsMmIHRoWSIrwss7IEcsdzj1hqoXaBLsaPog/QHxLi9 v8zg== X-Gm-Message-State: ANoB5pn8dd33vGhir8Gil1OzH2qF/0UkLeZrKG0d8M3QtRHKWdM/uYBQ 5lyxZnr3vx7sgrqdkODCVVtS4Qo0Ov8= X-Google-Smtp-Source: AA0mqf4ckHzM7h11UQc4UdSAsjI/QaON2DhllX8s9KmG7w9bgKE0G3q8DsInIFsWoGb3UTnjE3t8EA== X-Received: by 2002:ac8:682:0:b0:3a5:451d:2ca6 with SMTP id f2-20020ac80682000000b003a5451d2ca6mr2896103qth.88.1668196421115; Fri, 11 Nov 2022 11:53:41 -0800 (PST) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-08-184-147-142-10.dsl.bell.ca. [184.147.142.10]) by smtp.gmail.com with ESMTPSA id i17-20020ac85c11000000b00397e97baa96sm1794332qti.0.2022.11.11.11.53.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 11:53:40 -0800 (PST) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , Leah Leshchinsky , John Kacur Subject: [PATCH 5/8] rt-tests: rt_numa.h: Remove unused paramter max_cpus Date: Fri, 11 Nov 2022 14:53:20 -0500 Message-Id: <20221111195323.27402-5-jkacur@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111195323.27402-1-jkacur@redhat.com> References: <20221111195323.27402-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Remove unused parameter max_cpus. Note it doesn't appear that this function is currently being called Signed-off-by: John Kacur --- src/cyclictest/rt_numa.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cyclictest/rt_numa.h b/src/cyclictest/rt_numa.h index 03f060e144ce..59f63ae27e10 100644 --- a/src/cyclictest/rt_numa.h +++ b/src/cyclictest/rt_numa.h @@ -72,8 +72,7 @@ static inline unsigned int rt_numa_bitmask_isbitset( const struct bitmask *mask, return numa_bitmask_isbitset(mask,i); } -static inline struct bitmask* rt_numa_parse_cpustring(const char* s, - int max_cpus) +static inline struct bitmask* rt_numa_parse_cpustring(const char* s) { return numa_parse_cpustring_all(s); } From patchwork Fri Nov 11 19:53:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 624154 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1893CC4332F for ; Fri, 11 Nov 2022 19:53:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234273AbiKKTxs (ORCPT ); Fri, 11 Nov 2022 14:53:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234279AbiKKTxq (ORCPT ); Fri, 11 Nov 2022 14:53:46 -0500 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D31FD1583E for ; Fri, 11 Nov 2022 11:53:44 -0800 (PST) Received: by mail-qk1-x72b.google.com with SMTP id z17so3579038qki.11 for ; Fri, 11 Nov 2022 11:53:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=wK9CONtc3G9eq0TRe7qQrSZDDogI1s8NNa3t6DhNjMQ=; b=kgsBqArmEGLbkWpDrsvl0jjD9upEydSx9zZaXuf9SU2w1tiUDYM71KnMW4+EZLuiJ3 hJLOyHznufv1h0VQTiCbbhTjmKu/UsCMjxMwTlVeVtqNbdzJhQJQ/xCG5YVS7fbcfiS/ gtn/dBzPeL/9/+wmiyoXr7p6Cv3jV93Kt0evwuYNbTXYg83H7o/X5NRMzthPlq2lOWWg tR2BxBEpd3vF6isir4vzXQetkCu+0GbVL767pK1ZtqH+mwtVBm8Ncwc4bSj2RhuWKweZ iSVWH43CrVjIr4e5iG07+M/6KNof3E+vaitk00Pzex6yvZyCsmuvegrVrrUKh4uCwiuL LweA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wK9CONtc3G9eq0TRe7qQrSZDDogI1s8NNa3t6DhNjMQ=; b=WOkNQNWCxcbYs7AufzZylZLkpSOnFETETu96/+zxqlKsBST1cvClA3jcKM8NNaaMg0 CSxg9XFKRTUYYCeZ1mxDb/PLBKNYx2zkxxosGIxf767LOWWF+hun4Cy71nFd00PeqG0a clzNqNs0LvAghg8ZSpz8pV3n5pAa/ZmjLw2iOIkpZaobZZ0i3Ibi9p7qV2jbYgTVoaDF 7sT0aSZbHO3DQ4cHc08HJPTmWZQePTJV6LaHmJAZY52hWYD35rsLkb0ADq9VOswrrjnB FyWMtKximfS+UcpJT2A8OgqMIW4UiXDr2CPgIqMgZ+aOXSWJ2CbSWkXKqAtfu4d+w7pc RPug== X-Gm-Message-State: ANoB5pnIIa440vcpL6rexnqogHL7zV1NoS4NS/8BG4nz3TfFYfJMWImV aIKx/F4ZziXxfoAvvV5VBY7qeJ7and0= X-Google-Smtp-Source: AA0mqf4EFRE/novXank3c+9T7GXVrqOhZk8Gn0cONSE1X3Xp1BmGIQNOXj/ZpINlF2GgeMyustNYNw== X-Received: by 2002:a05:620a:b86:b0:6f3:e3b7:6a5b with SMTP id k6-20020a05620a0b8600b006f3e3b76a5bmr2433818qkh.607.1668196422888; Fri, 11 Nov 2022 11:53:42 -0800 (PST) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-08-184-147-142-10.dsl.bell.ca. [184.147.142.10]) by smtp.gmail.com with ESMTPSA id i17-20020ac85c11000000b00397e97baa96sm1794332qti.0.2022.11.11.11.53.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 11:53:42 -0800 (PST) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , Leah Leshchinsky , John Kacur Subject: [PATCH 6/8] rt-tests: hwlatdetect.py Covert to f-strings Date: Fri, 11 Nov 2022 14:53:21 -0500 Message-Id: <20221111195323.27402-6-jkacur@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111195323.27402-1-jkacur@redhat.com> References: <20221111195323.27402-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org From: Leah Leshchinsky Add f-strings where applicable for readability. Signed-off-by: Leah Leshchinsky Signed-off-by: John Kacur --- src/hwlatdetect/hwlatdetect.py | 74 +++++++++++++++++----------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py index 9ef50f862127..1efbe7a60059 100755 --- a/src/hwlatdetect/hwlatdetect.py +++ b/src/hwlatdetect/hwlatdetect.py @@ -59,7 +59,7 @@ class DebugFS: if self.premounted or self.mounted: debug("not mounting debugfs") return True - debug("mounting debugfs at %s" % path) + debug(f"mounting debugfs at {path}") self.mountpoint = path cmd = ['/bin/mount', '-t', 'debugfs', 'none', path] self.mounted = (subprocess.call(cmd) == 0) @@ -90,7 +90,7 @@ class DebugFS: try: val = f.readline() except OSError as e: - print("errno: %s" % e) + print(f"errno: {e}") if e.errno == errno.EAGAIN: val = None else: @@ -192,18 +192,18 @@ class Detector: count = 0 threshold = int(self.get("threshold")) self.c_states_off() - debug("enabling detector module (threshold: %d)" % threshold) + debug(f"enabling detector module (threshold: {threshold})") self.set("enable", 1) while self.get("enable") == 0: debug("still disabled, retrying in a bit") count += 1 time.sleep(0.1) - debug("retrying enable of detector module (%d)" % count) + debug(f"retrying enable of detector module ({count})") self.set("enable", 1) if self.get("threshold") != threshold: debug("start: threshold reset by start, fixing") self.set("threshold", threshold) - debug("detector module enabled (threshold: %d)" % int(self.get("threshold"))) + debug(f"detector module enabled (threshold: {int(self.get('threshold'))})") def stop(self): """ disable the detector """ @@ -214,7 +214,7 @@ class Detector: debug("still enabled, retrying in a bit") count += 1 time.sleep(0.1) - debug("retrying disable of detector module(%d)" % count) + debug(f"retrying disable of detector module({count})") self.set("enable", 0) self.c_states_on() debug("detector module disabled") @@ -248,7 +248,7 @@ class Tracer(Detector): self.outer = int(o) def __str__(self): - return "ts: %s, inner:%d, outer:%d" % (self.timestamp, self.inner, self.outer) + return f"ts: {self.timestamp}, inner:{self.inner}, outer:{self.outer}" def display(self): """ convert object to string and print """ @@ -322,8 +322,8 @@ class Tracer(Detector): if output: with open(output, "w") as f: for s in self.samples: - f.write("%s\n" % str(s)) - print("report saved to %s (%d samples)" % (output, len(self.samples))) + f.write(f"{s}\n") + print(f"report saved to {output} ({len(self.samples)} samples)") def display(self): for s in self.samples: @@ -341,7 +341,7 @@ def seconds(sval): if sval.isdigit(): return int(sval) if sval[-2].isalpha(): - raise RuntimeError("illegal suffix for seconds: '%s'" % sval[-2:-1]) + raise RuntimeError(f"illegal suffix for seconds: '{sval[-2:-1]}'") if sval[-1:] == 's': return int(sval[0:-1]) if sval[-1:] == 'm': @@ -352,7 +352,7 @@ def seconds(sval): return int(sval[0:-1]) * 86400 if sval[-1:] == 'w': return int(sval[0:-1]) * 86400 * 7 - raise RuntimeError("invalid input for seconds: '%s'" % sval) + raise RuntimeError(f"invalid input for seconds: '{sval}'") def milliseconds(sval): @@ -367,7 +367,7 @@ def milliseconds(sval): return int(sval[0:-1]) * 1000 * 60 if sval[-1] == 'h': return int(sval[0:-1]) * 1000 * 60 * 60 - raise RuntimeError("invalid input for milliseconds: %s" % sval) + raise RuntimeError(f"invalid input for milliseconds: {sval}") def microseconds(sval): @@ -380,7 +380,7 @@ def microseconds(sval): return int(sval[0:-2]) if sval[-1:] == 's': return int(sval[0:-1]) * 1000 * 1000 - raise RuntimeError("invalid input for microseconds: '%s'" % sval) + raise RuntimeError(f"invalid input for microseconds: '{sval}'") if __name__ == '__main__': @@ -444,37 +444,37 @@ if __name__ == '__main__': if args.threshold: t = microseconds(args.threshold) detect.set("threshold", t) - debug("threshold set to %dus" % t) + debug(f"threshold set to {t}us") if args.hardlimit: hardlimit = microseconds(args.hardlimit) else: hardlimit = int(detect.get("threshold")) - debug("hardlimit set to %dus" % hardlimit) + debug(f"hardlimit set to {hardlimit}us") if args.window: w = microseconds(args.window) if w < int(detect.get("width")): - debug("shrinking width to %d for new window of %d" % (w/2, w)) + debug(f"shrinking width to {w//2} for new window of {w}") detect.set("width", w/2) - debug("window parameter = %d" % w) + debug(f"window parameter = {w}") detect.set("window", w) - debug("window for sampling set to %dus" % w) + debug(f"window for sampling set to {w}us") if args.width: w = microseconds(args.width) if w > int(detect.get("window")): - debug("widening window to %d for new width of %d" % (w*2, w)) + debug(f"widening window to {w*2} for new width of {w}") detect.set("window", w*2) - debug("width parameter = %d" % w) + debug(f"width parameter = {w}") detect.set("width", w) - debug("sample width set to %dus" % w) + debug(f"sample width set to {w}us") if args.duration: detect.testduration = seconds(args.duration) else: detect.testduration = 120 # 2 minutes - debug("test duration is %ds" % detect.testduration) + debug(f"test duration is {detect.testduration}s") if args.watch: watch = True @@ -491,18 +491,18 @@ if __name__ == '__main__': l, r = map(int, [c, c]) for i in range(l, r + 1): cpumask |= (1 << i) - debug("set tracing_cpumask to %x" % cpumask) - detect.set("cpumask", "%x" % cpumask) + debug(f"set tracing_cpumask to {cpumask:x}") + detect.set("cpumask", f"{cpumask:x}") - info("hwlatdetect: test duration %d seconds" % detect.testduration) - info(" detector: %s" % detect.type) + info(f"hwlatdetect: test duration {detect.testduration} seconds") + info(f" detector: {detect.type}") info(" parameters:") - info(" CPU list: %s" % args.cpulist) - info(" Latency threshold: %dus" % int(detect.get("threshold"))) - info(" Sample window: %dus" % int(detect.get("window"))) - info(" Sample width: %dus" % int(detect.get("width"))) - info(" Non-sampling period: %dus" % (int(detect.get("window")) - int(detect.get("width")))) - info(" Output File: %s" % reportfile) + info(f" CPU list: {args.cpulist}") + info(f" Latency threshold: {int(detect.get('threshold'))}us") + info(f" Sample window: {int(detect.get('window'))}us") + info(f" Sample width: {int(detect.get('width'))}us") + info(f" Non-sampling period: {(int(detect.get('window')) - int(detect.get('width')))}us") + info(f" Output File: {reportfile}") info("\nStarting test") detect.detect() @@ -513,12 +513,12 @@ if __name__ == '__main__': if max_latency == 0: info("Max Latency: Below threshold") else: - info("Max Latency: %dus" % max_latency) + info(f"Max Latency: {int(max_latency)}us") - info("Samples recorded: %d" % len(detect.samples)) + info(f"Samples recorded: {len(detect.samples)}") exceeding = detect.get("count") - info("Samples exceeding threshold: %d" % exceeding) + info(f"Samples exceeding threshold: {exceeding}") if detect.have_msr: finishsmi = detect.getsmicounts() @@ -527,8 +527,8 @@ if __name__ == '__main__': if count > detect.initsmi[i]: smis = count - detect.initsmi[i] total_smis += smis - print("%d SMIs occured on cpu %d" % (smis, i)) - info("SMIs during run: %d" % total_smis) + print(f"{smis} SMIs occured on cpu {i}") + info(f"SMIs during run: {total_smis}") maxlatency = int(detect.get("max")) From patchwork Fri Nov 11 19:53:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 624706 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F24DC43217 for ; Fri, 11 Nov 2022 19:53:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234292AbiKKTxu (ORCPT ); Fri, 11 Nov 2022 14:53:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230303AbiKKTxr (ORCPT ); Fri, 11 Nov 2022 14:53:47 -0500 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97A6D15A1E for ; Fri, 11 Nov 2022 11:53:46 -0800 (PST) Received: by mail-qv1-xf35.google.com with SMTP id e15so3973982qvo.4 for ; Fri, 11 Nov 2022 11:53:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=i2y5J8TsLs6NnpkLLECqfh+kMBZ0yK44t2BpYgDC7JM=; b=IBTnhAL+PJv39Vjov4fFaYDXVSAcNYYpCQW6s7b1estdrAJPHeEnJkrBYplSrdPIS2 2Kxu+G0dbz8L8RVh29Phh65etTIvgqLJG89bxl2K46XTg/ZD7ST/0kmYEvmkHnWgLv7g nz6HzZUstDv7udqpO2maeRLqOBDdbXftrkcjZvjABbgMu6lMeHTjfKgINMcpB4kPHoFl d13E3/1m8tCnmvN6JXfYgQf+fT2g0VYNj/JQDIAvoqfAt+1tVSgzPD/blTnUmb1HukbR AGKG9YlO2TK2qviPf5InNzBRH16Q3Ili3K8jRScDoMlPl+Ofj+x1IjJ8RkUlGQ2+Tljv KunA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=i2y5J8TsLs6NnpkLLECqfh+kMBZ0yK44t2BpYgDC7JM=; b=DF2YR02IpYf8kp9fF64VYUhwyROOnIgaNtNY/BvKiZDl81SqjjFgNxljE/NOcjym79 /75yHxbupT0caJFT3eqkP67nTDvIR970++cGrUaNJFfFBCHFQ9X8efkrUEAJ3r1zbs42 LwDBr0GTR1mjpXv2cGNyNupufoW4SDWWmpr0hl76e7AC+P3jC2rGUIYiQBWFJFSg+AJ8 svrWYY7p2JrYSdHaOUbYwNqTV2sLYxEuVMtbQjjVvmPRKyx3wchgJLN/B5SVseS8O+zC UHSEpOx1IEKUMEkcEd+K0e1dzgm3nfs+lJj8YE8RDP8hKjUfa4asOqgcAuNNMD8rc/Fy rYMQ== X-Gm-Message-State: ANoB5pl/euimVGOZRxrpgu9pQXaiQ9lppGK6eGcCyJ6MlRTaUURM255P tAyBRXr4jucomUaEOKAcwHVrM97BiNk= X-Google-Smtp-Source: AA0mqf6AsMvQBtsLHJdGiq2pJgl415kGEB4jaBE5byQvv3Hjj1sz2HwJ8v9YPvTAmRsehghhSSzXmg== X-Received: by 2002:a0c:ff07:0:b0:4b1:b025:54e6 with SMTP id w7-20020a0cff07000000b004b1b02554e6mr3351710qvt.53.1668196425132; Fri, 11 Nov 2022 11:53:45 -0800 (PST) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-08-184-147-142-10.dsl.bell.ca. [184.147.142.10]) by smtp.gmail.com with ESMTPSA id i17-20020ac85c11000000b00397e97baa96sm1794332qti.0.2022.11.11.11.53.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 11:53:44 -0800 (PST) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , Leah Leshchinsky , John Kacur Subject: [PATCH 7/8] rt-tests: hwlatdetect: Update to integer division Date: Fri, 11 Nov 2022 14:53:22 -0500 Message-Id: <20221111195323.27402-7-jkacur@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111195323.27402-1-jkacur@redhat.com> References: <20221111195323.27402-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org From: Leah Leshchinsky In Python 3, "/" is a float division operator, as opposed to Python 2, which defaults to integer division. This results in an error when calculating width, which assumes an integer. Update width division to integer division with the "//" operator. Signed-off-by: Leah Leshchinsky Signed-off-by: John Kacur --- src/hwlatdetect/hwlatdetect.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py index 1efbe7a60059..c5b3a689dcd1 100755 --- a/src/hwlatdetect/hwlatdetect.py +++ b/src/hwlatdetect/hwlatdetect.py @@ -454,9 +454,10 @@ if __name__ == '__main__': if args.window: w = microseconds(args.window) + width = w//2 if w < int(detect.get("width")): - debug(f"shrinking width to {w//2} for new window of {w}") - detect.set("width", w/2) + debug(f"shrinking width to {width} for new window of {w}") + detect.set("width", width) debug(f"window parameter = {w}") detect.set("window", w) debug(f"window for sampling set to {w}us") From patchwork Fri Nov 11 19:53:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 624153 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED246C433FE for ; Fri, 11 Nov 2022 19:53:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234317AbiKKTxv (ORCPT ); Fri, 11 Nov 2022 14:53:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234299AbiKKTxs (ORCPT ); Fri, 11 Nov 2022 14:53:48 -0500 Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6907020F6D for ; Fri, 11 Nov 2022 11:53:48 -0800 (PST) Received: by mail-qk1-x72b.google.com with SMTP id g10so3593104qkl.6 for ; Fri, 11 Nov 2022 11:53:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=kS4LT3r+baucYCk9MJKod0wvesZNb9jMBFqLw552ISQ=; b=FjAWhDJ+iPOPSABqwi3ZIegNphnnT7KW8RHGfF5nQYGMOdyH6MG7F2jXyg8ch1DFFX ON2VYFvW6xhGwYVC6K5MtG2MerPhsfVlxNSKGN+VahuNLGDK/gnqB+xvYC9gw0ReWV0C fppQ1/sMXMXK5Hx6TenL2t+LrgKmgyfzl5SK9AyfBZZBi6Qu9ubBArWIe7bs7VC8QgGk lA1crmmpg6cm4pt7AweZH/pto9TKM3F452oXqTgZLZw6FoSLs3orYSQ+kcL8pQy7+atT P5hAAhg02wGgZToTMPnu4ae0hpIseT7VSt+VL/D2lHueck6bYAn2wxCRe83AflZGxuXy 1lEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=kS4LT3r+baucYCk9MJKod0wvesZNb9jMBFqLw552ISQ=; b=Zpb02Qx/hZOpjE31b2HOhRDIbZTazjKEvGpqWu18mWbf0SM4sf9P6DB7LyQVE0f69w J80hqHnSjOV/L3JSuhzDSPvz/QgHJjaKjc4rOHuzbI4PkO8pNQ61+jB0j9F3DGXJ5hNv MW+nFyQJzJL3bIdEdIA7VgQYGCza34KeUIRmUj18fkr6P7U7WA9Zm3+O3jmmHorRRgca NJ5GcGxdkkaD1z7IGxaDaccT8jakysX6btAAaO08WxGoCzDLNHwTUxaC6q7o7/kMg4n4 dhkjF0KyM6qrLA+MdWAGE8lK9ZfxFEMiE7+s3xwyrpkGZNwUfeIzv/lIJqXi72RreT5g /JuQ== X-Gm-Message-State: ANoB5pkSOYHA1mEspFUjBwBik+Gxpg63ZLOVq8GD0K0coK1i6QaR6aeS L7GbUvqoo521pZ6ohphB7pz1tNIcdeE= X-Google-Smtp-Source: AA0mqf4ILtSWma1ISoE7eH4hIMCDTdY5M2ES1g7v4KnS1tYnwn9pMqLLnoP3yITwUCPN0EvTHQHKXw== X-Received: by 2002:a37:8785:0:b0:6f9:25e5:8398 with SMTP id j127-20020a378785000000b006f925e58398mr2465915qkd.231.1668196426796; Fri, 11 Nov 2022 11:53:46 -0800 (PST) Received: from fionn.redhat.com (bras-base-rdwyon0600w-grc-08-184-147-142-10.dsl.bell.ca. [184.147.142.10]) by smtp.gmail.com with ESMTPSA id i17-20020ac85c11000000b00397e97baa96sm1794332qti.0.2022.11.11.11.53.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 11:53:46 -0800 (PST) Sender: John Kacur From: John Kacur To: RT Cc: Clark Williams , Leah Leshchinsky , John Kacur Subject: [PATCH 8/8] rt-tests: hwlatdetect: Fix incorrect comment about testduration Date: Fri, 11 Nov 2022 14:53:23 -0500 Message-Id: <20221111195323.27402-8-jkacur@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111195323.27402-1-jkacur@redhat.com> References: <20221111195323.27402-1-jkacur@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org At some point self.testduration = 10 was changed to self.testduration = 30 but retained the comment, "ten seconds" Just change the comment to say, "in seconds" so it's clear what unit we are talking about. Signed-off-by: John Kacur --- src/hwlatdetect/hwlatdetect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hwlatdetect/hwlatdetect.py b/src/hwlatdetect/hwlatdetect.py index c5b3a689dcd1..68df58f7e2d0 100755 --- a/src/hwlatdetect/hwlatdetect.py +++ b/src/hwlatdetect/hwlatdetect.py @@ -130,7 +130,7 @@ class Detector: if not self.debugfs.mount(): raise RuntimeError("failed to mount debugfs") self.samples = [] - self.testduration = 30 # ten seconds + self.testduration = 30 # in seconds self.have_msr = False self.initsmi = [] if os.path.exists('/usr/sbin/rdmsr'):