From patchwork Thu Jan 23 20:50:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 213252 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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, 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 78766C33CB8 for ; Thu, 23 Jan 2020 20:50:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 486C920684 for ; Thu, 23 Jan 2020 20:50:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bVuGFDLp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729287AbgAWUup (ORCPT ); Thu, 23 Jan 2020 15:50:45 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:43948 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729327AbgAWUuo (ORCPT ); Thu, 23 Jan 2020 15:50:44 -0500 Received: by mail-qk1-f193.google.com with SMTP id j20so4873119qka.10 for ; Thu, 23 Jan 2020 12:50:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bgpDKLQpWTiMfc6oaiwgz5xzOsjriaH7vbdkmXLcbHs=; b=bVuGFDLpfssJu9MRMJ2EFVPWN5ErIRHLcX9lhyVHNQD+HCapRzcyirD4/J22fXDafQ fHLUY+OnBK7s1OvTubAxhAOI9qrj/Fwh7+V4i9cfRop7FIyPbwp72NqhR0Ul0fQs1c2E WHLj4tWGXGqubt8oZW2k55Qoq1s4bcVhqBI4UHGEoxw2WLp14WC6OJbGbprjHBWcmYBi rzW16G4ymM9HpnKv7Kh74foGL0b9y2FDKNzQPiQIEIjyzGWHJ2rHAVnUTdM5kw/hoLPN 6UtZYMxMJJqsHuv+adeOHg0S0XKf93tIDg7eqGkItXtf5S+DN5mgD4OWKzbbUfh6HCfu Yx5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=bgpDKLQpWTiMfc6oaiwgz5xzOsjriaH7vbdkmXLcbHs=; b=qLhrBTOKd+Pvwhx6G9vpkhhFh19F3iyEAwsDy1bqHB2erfAosHuRJ9CBXL1bdm+TqJ CpAMA2U7AHDfcYWxSUXzIMXXJWf7MTaHt6mDeb8EJX3b9AugJUgMYP9fWPBqxFuFTC0u 2nT/9azzkwfS2fi+XoYCxG3DUTi0nyR6gv8O7oLCrGDBemKIa41w4cKRoxjTyqDDZtFs qr59xFXH7zZAauGSDUhbPt+78FEyuG5i/lz4E0OUJsCvYn76j9+uHl0JvpnE5+KjfSuI /fM73yiV/YhmcaE72yXk4YVLpvNmV7L3tfatn25Pv7+HYrxdtvaCNzwiYal2Z2iVzhPq DJVw== X-Gm-Message-State: APjAAAVuGRPGp5kozodA6cBxeiZY9I9I2wl/MlZtkNdOi2kRE4NFm4gR 4Sr3RbhFa8cuolK25IV6hsrZTWGkVGc= X-Google-Smtp-Source: APXvYqxEu2wX9u6TrFwEkMEwUpsqoawmOZ9yb23ZSdiT1ruAcW7A8oygGULQv5KpKc7W54bzK8gyZw== X-Received: by 2002:a37:27cc:: with SMTP id n195mr30955qkn.428.1579812643604; Thu, 23 Jan 2020 12:50:43 -0800 (PST) Received: from planxty.redhat.com (rdwyon0600w-lp130-03-64-231-46-127.dsl.bell.ca. [64.231.46.127]) by smtp.gmail.com with ESMTPSA id j185sm1518346qkc.96.2020.01.23.12.50.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2020 12:50:43 -0800 (PST) From: John Kacur To: RT Cc: Clark Williams , John Kacur Subject: [PATCH 3/9] rt-tests: pi_stress: Add short options to usage message Date: Thu, 23 Jan 2020 21:50:23 +0100 Message-Id: <20200123205029.20176-4-jkacur@redhat.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200123205029.20176-1-jkacur@redhat.com> References: <20200123205029.20176-1-jkacur@redhat.com> MIME-Version: 1.0 Sender: linux-rt-users-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Add short options to usage message. Note, the options all ready exist, they simply were not documented in the usage message. Signed-off-by: John Kacur --- src/pi_tests/pi_stress.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c index 7fa98dfb9ad4..0ed844c636cd 100644 --- a/src/pi_tests/pi_stress.c +++ b/src/pi_tests/pi_stress.c @@ -1008,29 +1008,25 @@ void *high_priority(void *arg) void usage(void) { - printf("usage: pi_stress \n"); - printf(" options:\n"); - printf("\t--verbose\t- lots of output\n"); - printf("\t--quiet\t\t- suppress running output\n"); - printf - ("\t--duration=\t- length of the test run in seconds [infinite]\n"); - printf("\t\t\t Append 'm', 'h', or 'd' to specify minutes, hours or days.\n"); - printf("\t--groups=\t- set the number of inversion groups [%d]\n", + printf("usage: pi_stress \n\n"); + printf("-v\t--verbose\t- lots of output\n"); + printf("-q\t--quiet\t\t- suppress running output\n"); + printf ("-D TIME\t--duration=TIME\n\t\t\t- length of test run in seconds (default is infinite)\n"); + printf("\t\t\t Append 'm', 'h', or 'd'\n\t\t\t to specify minutes, hours or days.\n"); + printf("-g\t--groups=\t- set the number of inversion groups [%d]\n", ngroups); - printf - ("\t--inversions=- number of inversions per group [infinite]\n"); - printf("\t--rr\t\t- use SCHED_RR for test threads [SCHED_FIFO]\n"); - printf("\t--sched\t\t- scheduling options per thread type:\n"); + printf ("-i INVERSIONS\t\t--inversions=INVERSIONS\n\t\t\t number of inversions per group (default is infinite)\n"); + printf("-r\t--rr\t\t- use SCHED_RR for test threads [SCHED_FIFO]\n"); + printf("-s SCHED_OPTS\t--sched\t\t- scheduling options per thread type:\n"); printf("\t\tid=[high|med|low]\t\t\t- select thread\n"); printf("\t\t,policy=[fifo,rr],priority=\t\t- SCHED_FIFO or SCHED_RR\n"); printf("\t\t,policy=deadline,runtime=,deadline=,period=\t- SCHED_DEADLINE\n"); - printf("\t--prompt\t- prompt before starting the test\n"); - printf - ("\t--uniprocessor\t- force all threads to run on one processor\n"); - printf("\t--mlockall\t- lock current and future memory\n"); - printf("\t--debug\t\t- turn on debug prints\n"); - printf("\t--version\t- print version number on output\n"); - printf("\t--help\t\t- print this message\n"); + printf("-p\t--prompt\t- prompt before starting the test\n"); + printf ("-u\t--uniprocessor\t- force all threads to run on one processor\n"); + printf("-m\t--mlockall\t- lock current and future memory\n"); + printf("-d\t--debug\t\t- turn on debug prints\n"); + printf("-V\t--version\t- print version number on output\n"); + printf("-h\t--help\t\t- print this message\n"); } /* block all signals (called from main) */ From patchwork Thu Jan 23 20:50:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 213251 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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, 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 34029C2D0DB for ; Thu, 23 Jan 2020 20:50:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E432620684 for ; Thu, 23 Jan 2020 20:50:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Xt656ung" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729342AbgAWUuq (ORCPT ); Thu, 23 Jan 2020 15:50:46 -0500 Received: from mail-qk1-f196.google.com ([209.85.222.196]:42385 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728799AbgAWUup (ORCPT ); Thu, 23 Jan 2020 15:50:45 -0500 Received: by mail-qk1-f196.google.com with SMTP id q15so4890181qke.9 for ; Thu, 23 Jan 2020 12:50:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tA6xWF4OiGf3KLjGAKnbOMhD28U+NdPd47NjH9GykIc=; b=Xt656ungzYPuYTE+ahZReHSIc89zIQTCOwgiU61Oa9boEt/l2DrShP+SMdAWwNpi00 B47+wu8kRY5rZHBK7U7Asj0juzi8NTaQgCn0LaC8Ul+ZckU70C+l1LOGsB5cXnCtrmG+ HkWSktbv6nAkCq7pdPQR1lJycqONnC7XX06zvgiyg4WvObHovftWwAqZW0JIUj9qh09n lbABn04VkMzmDgZjv/KDRE7QeaWELOPdPB2gCa8TXH3cPpRT5ryJY2fNcgJV/DUFxGD4 flBHzlqi2Pe0zBROWH7YfyMyRbbUuK1J/ooPcfm9E26uHFNYUzp9Z3zmpXUr4I2Fcmi3 9Q4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=tA6xWF4OiGf3KLjGAKnbOMhD28U+NdPd47NjH9GykIc=; b=OyAnrjr65umWVNS1a0pxtKUjBsDqP0PSl/iZxURB+V7E5jGMCOEUWAtvuExEb1HOmn /4AthGA5UGfW0MA5umFe75Ba0LYrG4ZDukzaMl1npfNdJcahrLYfBUSoT/j1OxnwOSM2 LDHc3TFIao/yyDjpzydxtGlHCDACMM0E90oS5xqlJNdOEH7urSCW594lXeriZ8OZNF9W Os0O4toIKCqI+z6/u0GPqtNjZK8CGZYiP2d8eEtzkbLveLD3JVwJJV8Q/+f8WTXRa7fr hdPzw8Ecmq5O1NTE0lqks1t7coX7Z0JOeQb+q2RoiVS77O71O67r3pwZeCFtugYgGk64 MizQ== X-Gm-Message-State: APjAAAW9DwT9L0VGRdOdBrOAgGygQuCTsOaYUHj5HBY0uHwRCtTIol60 OQqtCdU3jEEHM+PHdvgq7XgeY5tCa/8= X-Google-Smtp-Source: APXvYqzOUSHrpO1pi+ATP22OBp2EuatB3ROPng3vJNKR/LVA+D7NFYfTvLrQM1WGf4gpIQJDKwRsGQ== X-Received: by 2002:a05:620a:1324:: with SMTP id p4mr18541857qkj.497.1579812644496; Thu, 23 Jan 2020 12:50:44 -0800 (PST) Received: from planxty.redhat.com (rdwyon0600w-lp130-03-64-231-46-127.dsl.bell.ca. [64.231.46.127]) by smtp.gmail.com with ESMTPSA id j185sm1518346qkc.96.2020.01.23.12.50.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2020 12:50:44 -0800 (PST) From: John Kacur To: RT Cc: Clark Williams , John Kacur Subject: [PATCH 4/9] rt-tests: pi_stress: Sync man page with help Date: Thu, 23 Jan 2020 21:50:24 +0100 Message-Id: <20200123205029.20176-5-jkacur@redhat.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200123205029.20176-1-jkacur@redhat.com> References: <20200123205029.20176-1-jkacur@redhat.com> MIME-Version: 1.0 Sender: linux-rt-users-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Sync the man page with help. Specifically, remove the signal option which is not supported and document the sched option Signed-off-by: John Kacur --- src/pi_tests/pi_stress.8 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pi_tests/pi_stress.8 b/src/pi_tests/pi_stress.8 index 475d3c34f135..5e2af6189ca1 100644 --- a/src/pi_tests/pi_stress.8 +++ b/src/pi_tests/pi_stress.8 @@ -21,7 +21,8 @@ pi_stress \- a stress test for POSIX Priority Inheritance mutexes .IR groups .RB [ \-d|\-\-debug ] .RB [ \-v|\-\-verbose ] -.RB [ \-s|\-\-signal ] +.RB [ \-s|\-\-sched +.IR sched_opts ] .RB [ \-r|\-\-rr ] .RB [ \-p|\-\-prompt ] .RB [ \-m|\-\-mlockall ] @@ -63,12 +64,12 @@ Specify a length for the test run. Append 'm', 'h', or 'd' to specify minutes, hours or days. .IP \-v|\-\-verbose Run with verbose messages -.IP \-s|\-\-signal -Terminate on receipt of SIGTERM (Ctrl-C). Default is to terminate on -any keypress. .IP \-r|\-\-rr Run inversion group threads as SCHED_RR (round-robin). The default is to run the inversion threads as SCHED_FIFO. +.IP \-s|\-\-sched +scheduling options per thread type: +id=[high|med|low],policy=[fifo,rr],priority=,policy=deadline,runtime=,deadline=,period= .IP \-p|\-\-prompt Prompt before actually starting the stress test .IP \-u|\-\-uniprocessor From patchwork Thu Jan 23 20:50:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 213250 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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, 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 07A37C2D0DB for ; Thu, 23 Jan 2020 20:50:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BEF6620684 for ; Thu, 23 Jan 2020 20:50:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z++FPZTq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729353AbgAWUut (ORCPT ); Thu, 23 Jan 2020 15:50:49 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:46541 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729100AbgAWUus (ORCPT ); Thu, 23 Jan 2020 15:50:48 -0500 Received: by mail-qk1-f194.google.com with SMTP id g195so3488779qke.13 for ; Thu, 23 Jan 2020 12:50:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oYambi9+6gRZ6zd64W8SKJQfnPAUVoiXAO2XPjEnfVU=; b=Z++FPZTqyGAxlN2OEn2BpnvAvFHrA92YLTvs6Cpi19hpi8FSFKhqfeZnLM8vJl+mg/ 2kGjiFLiqknXEvSp2QCxLtbn0SCztc0n0bmcSeEi9GuM/ZZ4xdcWb5l4Izb+lmump1Ko 1APGKVMXcUdr0KbOZeNGExlLZCO+GL3OdcxdxJw8LSYKuEMDI5h07wXRIK/ilCh75eUY +8GXTDRvRA8cfjbkAYzm82Q0/SRjIb+ebOFKoVLPBbboTs3UD3lSDsbJBfPdNoZFO+lw H8kpkTEReYiMCE6PhK2+sTRQ6YAm5HV1PxGQ4RRwFJjSPg937/s/MmvjIxqSnZqhCIxc MWbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=oYambi9+6gRZ6zd64W8SKJQfnPAUVoiXAO2XPjEnfVU=; b=mPvpAXjyGNghQfq6ZpDpWecPQi4YOfPOSIsn/iWmm2XrN1PzunbnK7WmAYXPsp6Xq7 13v+pIjYBNTkdedfZ72VYfms0fW8udLWQslFHdx1ekrF4buF5KL7TXxM6ltzSazxBaNb wp2Lryl7iNARKyVlrMZgoEWwU/qPbOeGxa+43AKgN6jo3Vnrph9m10KnSXuQMumfQM87 CTmTUIrKixsdI7zj3XydJQI6FsYzbSQq2O7CwQEcPyqaOmv5DNOqkeSDO1iO3nBfuuVN gPuF71GkNpY/jhg/ytnOHL1va9JFYhavR0amAqowMQo31YdYb1KEyOm2yaNlTJSIl3x5 1FDg== X-Gm-Message-State: APjAAAUokXe/FdAhSzNeOcdXQqJKbxgdD/sDSg7XSQqNIdfCUuP/+aEZ EsDcMDqS/oDwM+6fbg4WsQX5TNgDv/c= X-Google-Smtp-Source: APXvYqysdGzcoVdgsJ7OxjNlME5R6eIR+fwBLip27a3Fjsk5QCZLPATexFVWEU4VB5Laxyl+0GexgQ== X-Received: by 2002:ae9:e910:: with SMTP id x16mr74155qkf.90.1579812647128; Thu, 23 Jan 2020 12:50:47 -0800 (PST) Received: from planxty.redhat.com (rdwyon0600w-lp130-03-64-231-46-127.dsl.bell.ca. [64.231.46.127]) by smtp.gmail.com with ESMTPSA id j185sm1518346qkc.96.2020.01.23.12.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2020 12:50:46 -0800 (PST) From: John Kacur To: RT Cc: Clark Williams , John Kacur Subject: [PATCH 6/9] rt-tests: determine_maximum_mpps.sh: Fix quoting and other shell issue Date: Thu, 23 Jan 2020 21:50:26 +0100 Message-Id: <20200123205029.20176-7-jkacur@redhat.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200123205029.20176-1-jkacur@redhat.com> References: <20200123205029.20176-1-jkacur@redhat.com> MIME-Version: 1.0 Sender: linux-rt-users-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Fix a number of issues in the script determine_maximum_mpps.sh such as 1. Convert legacy backticks to $(...) notation 2. Double quote where necessary to prevent globbing 3. Double quote where necessary to prevent word splitting. Note: these fixes are more than just cosmetic, they are needed for the script to work correctly. Signed-off-by: John Kacur --- src/queuelat/determine_maximum_mpps.sh | 75 +++++++++++++------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/src/queuelat/determine_maximum_mpps.sh b/src/queuelat/determine_maximum_mpps.sh index f6cf1dea27cf..f785147f1bbd 100755 --- a/src/queuelat/determine_maximum_mpps.sh +++ b/src/queuelat/determine_maximum_mpps.sh @@ -17,65 +17,65 @@ echo "Determining maximum mpps the machine can handle" echo "Will take a few minutes to determine mpps value" echo "And 10 minutes run to confirm the final mpps value is stable" -for mpps in `seq 3 3 50`; do - echo testing $mpps Mpps +for mpps in $(seq 3 3 50); do + echo testing "$mpps" Mpps - OUTFILE=`mktemp` - $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p "$mpps" -t 30 > $OUTFILE + OUTFILE=$(mktemp) + $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f "$(sh get_cpuinfo_mhz.sh)" -p "$mpps" -t 30 > "$OUTFILE" - exceeded=`grep exceeded $OUTFILE` + exceeded=$(grep exceeded "$OUTFILE") if [ ! -z "$exceeded" ]; then - echo mpps failed: $mpps + echo mpps failed: "$mpps" break; fi echo success done -echo first loop mpps: $mpps +echo first loop mpps: "$mpps" first_mpps=$(($mpps - 1)) -for mpps in `seq $first_mpps -1 3`; do - echo testing $mpps Mpps +for mpps in $(seq $first_mpps -1 3); do + echo testing "$mpps" Mpps - OUTFILE=`mktemp` - $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p "$mpps" -t 30 > $OUTFILE + OUTFILE=$(mktemp) + $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f "$(sh get_cpuinfo_mhz.sh)" -p "$mpps" -t 30 > "$OUTFILE" - exceeded=`grep exceeded $OUTFILE` + exceeded=$(grep exceeded "$OUTFILE") if [ -z "$exceeded" ]; then - echo mpps success $mpps + echo mpps success "$mpps" break; fi echo failure done -second_mpps=`echo "$mpps + 0.3" | bc` -echo second loop mpps: $mpps +second_mpps=$(echo "$mpps + 0.3" | bc) +echo second loop mpps: "$mpps" -for mpps in `seq $second_mpps 0.3 $first_mpps`; do - echo testing $mpps Mpps +for mpps in $(seq "$second_mpps" 0.3 $first_mpps); do + echo testing "$mpps" Mpps - OUTFILE=`mktemp` - $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p "$mpps" -t 30 > $OUTFILE + OUTFILE=$(mktemp) + $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f "$(sh get_cpuinfo_mhz.sh)" -p "$mpps" -t 30 > "$OUTFILE" - exceeded=`grep exceeded $OUTFILE` + exceeded=$(grep exceeded "$OUTFILE") if [ ! -z "$exceeded" ]; then - echo mpps failure $mpps + echo mpps failure "$mpps" break; fi echo success done -echo third loop mpps: $mpps -third_mpps=`echo "$mpps -0.1" | bc` +echo third loop mpps: "$mpps" +third_mpps=$(echo "$mpps -0.1" | bc) -for mpps in `seq $third_mpps -0.1 3`; do - echo testing $mpps Mpps +for mpps in $(seq "$third_mpps" -0.1 3); do + echo testing "$mpps" Mpps - OUTFILE=`mktemp` - $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `sh get_cpuinfo_mhz.sh` -p "$mpps" -t 30 > $OUTFILE + OUTFILE=$(mktemp) + $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f "$(sh get_cpuinfo_mhz.sh)" -p "$mpps" -t 30 > "$OUTFILE" - exceeded=`grep exceeded $OUTFILE` + exceeded=$(grep exceeded "$OUTFILE") if [ -z "$exceeded" ]; then - echo mpps success $mpps + echo mpps success "$mpps" break; fi echo failure @@ -89,14 +89,14 @@ while [ $queuelat_failure == 1 ]; do echo -n "Starting 10 runs of 30 seconds with " echo "$mpps Mpps" - for i in `seq 1 10`; do - $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `get_cpuinfo_mhz.sh` -p "$mpps" -t 30 > $OUTFILE - exceeded=`grep exceeded $OUTFILE` + for i in $(seq 1 10); do + $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f "$(get_cpuinfo_mhz.sh)" -p "$mpps" -t 30 > "$OUTFILE" + exceeded=$(grep exceeded "$OUTFILE") if [ ! -z "$exceeded" ]; then echo "mpps failure (run $i) $mpps" export queuelat_failure=1 - mpps=`echo $mpps - 0.1 | bc` + mpps=$(echo "$mpps" - 0.1 | bc) export mpps break fi @@ -113,19 +113,20 @@ while [ $queuelat_failure == 1 ]; do echo -n "Starting 10 minutes run with " echo "$mpps Mpps" - $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f `get_cpuinfo_mhz.sh` -p "$mpps" -t 600 > $OUTFILE - exceeded=`grep exceeded $OUTFILE` + $PREAMBLE queuelat -m $MAXLAT -c $CYCLES_PER_PACKET -f "$(get_cpuinfo_mhz.sh)" -p "$mpps" -t 600 > "$OUTFILE" + exceeded=$(grep exceeded "$OUTFILE") if [ ! -z "$exceeded" ]; then echo "mpps failure (run $i) $mpps" export queuelat_failure=1 - export mpps=`echo $mpps - 0.1 | bc` + mpps=$(echo "$mpps" - 0.1 | bc) + export mpps continue fi echo "run $i success" done -echo Final mpps is: $mpps +echo Final mpps is: "$mpps" unset queuelat_failure unset mpps From patchwork Thu Jan 23 20:50:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Kacur X-Patchwork-Id: 213249 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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, 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 25674C33CAF for ; Thu, 23 Jan 2020 20:50:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5C2D20704 for ; Thu, 23 Jan 2020 20:50:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IoMZchKY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729368AbgAWUuv (ORCPT ); Thu, 23 Jan 2020 15:50:51 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:35605 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729100AbgAWUuv (ORCPT ); Thu, 23 Jan 2020 15:50:51 -0500 Received: by mail-qt1-f195.google.com with SMTP id e12so3649099qto.2 for ; Thu, 23 Jan 2020 12:50:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/vLYBYLeMfkKiZ4YnCaIIeIV6z0k5npsSK4dn5STCnE=; b=IoMZchKYAk+lLw0G+W87VvoAsv0znnZuT9zMQLDmU6ZlvhzoTLXrkavk9+RScozErE vl+LRhUrtwHOhrlmJS9tf3GcvMqKqNZyjKUl0qZGUbYVermhSApY3rAbeybUtE7zTVK4 2bk+bFbqH5m28M2tO5xJEN2vs8XQTAS3d3KlRYc+D5HGyL8ULzV/RvxiCtVtju/WsCL1 d1wU3Ov+/sg/9kGaGEdezQ9l+OVy3MyIpQijbskpvRkAdWHAFHWhi+jZuNKUMf9z9jBO s8yOUfNyDx+BWzXrbTyR0HaMoonDu2b0KJTPS8CrgGogLvTsdmn0eDSpzbg2aWDPE9Ew p5DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=/vLYBYLeMfkKiZ4YnCaIIeIV6z0k5npsSK4dn5STCnE=; b=rUch0tysULkvh0mrOzKZzDmB4bLZCua6jsVGfSinQzIIUpyPhtI1NT7hAeqwtq+tyh KvKDw/RW9z9DQXgKHPsJalZXv09tgU/QIhXuY2leZVVupyv2tQgzOsWeldTl7OTeaTkI /ECpOB5ecbnSNJeM6N/53ogUmahRE1b0xCwB++C0umxbhhMUCSWJl3k6fcWkbSGx810k HMfZHBsxkDHelbAhlHh4RqN6+EpfuZsqZOkRKgAoHFFa7xDETonmoSnNFm6VeNrqr8Xe Zmsj4Q2QZApNg4bvkIS8MfX2xYEwC4xrVIq23igkIHaVjZNOXCNmUJesIY9PBvHhXzZ/ DE0g== X-Gm-Message-State: APjAAAWVxtPAB8UcBXEMD0pkRLc8Fbu/vQCuxrO+LmdBOEPzrJuRyL5T n/RGD5io85F3rJs67r4AB59PC7jJYBE= X-Google-Smtp-Source: APXvYqzKCJB5+BsryCMbwqFYRWI1fnw3bIJpCr2Kpo1/jpXazx18lCGBL6bOD3x3Rdk3YnAQeU8WwA== X-Received: by 2002:ac8:604b:: with SMTP id k11mr30484qtm.372.1579812649760; Thu, 23 Jan 2020 12:50:49 -0800 (PST) Received: from planxty.redhat.com (rdwyon0600w-lp130-03-64-231-46-127.dsl.bell.ca. [64.231.46.127]) by smtp.gmail.com with ESMTPSA id j185sm1518346qkc.96.2020.01.23.12.50.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2020 12:50:49 -0800 (PST) From: John Kacur To: RT Cc: Clark Williams , John Kacur Subject: [PATCH 8/9] rt-tests: queuelat: Fixes to man page and display_help Date: Thu, 23 Jan 2020 21:50:28 +0100 Message-Id: <20200123205029.20176-9-jkacur@redhat.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200123205029.20176-1-jkacur@redhat.com> References: <20200123205029.20176-1-jkacur@redhat.com> MIME-Version: 1.0 Sender: linux-rt-users-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org - Make sure that help is displayed and not just the message "Unknown option" when the options are incorrect. - Add -q to the man page and to the print_help() Signed-off-by: John Kacur --- src/queuelat/queuelat.8 | 4 +++- src/queuelat/queuelat.c | 22 +++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/queuelat/queuelat.8 b/src/queuelat/queuelat.8 index d68beb98bff7..f67a0bb7556e 100644 --- a/src/queuelat/queuelat.8 +++ b/src/queuelat/queuelat.8 @@ -52,7 +52,9 @@ TSC frequency in MHz. .TP .B \-t timeout Timeout in seconds to quit the program. - +.TP +.B \-q min_queue_len_to_print_trace +Minimum queue length to print in the trace .SH AUTHOR queuelat was written by Marcelo Tosatti diff --git a/src/queuelat/queuelat.c b/src/queuelat/queuelat.c index 98346f346f82..7e5e35768a8b 100644 --- a/src/queuelat/queuelat.c +++ b/src/queuelat/queuelat.c @@ -571,6 +571,7 @@ void print_help(void) printf("-p million-packet-per-sec (million packets per second) (float)\n"); printf("-f tsc-freq-mhz (TSC frequency in MHz) (float)\n"); printf("-t timeout (timeout, in seconds) (int)\n"); + printf("-q min_queue_len_to_print_trace (int)\n"); } int main(int argc, char **argv) @@ -616,22 +617,25 @@ int main(int argc, char **argv) return 0; case '?': if (optopt == 'm' || optopt == 'c' || optopt == 'p' || - optopt == 'f' || optopt == 't' || optopt == 'q') + optopt == 'f' || optopt == 't' || optopt == 'q') { printf ("Option -%c requires an argument.\n", optopt); - else if (isprint (optopt)) + } else if (isprint (optopt)) { printf ("Unknown option `-%c'.\n", optopt); - else - printf ( "Unknown option character `\\x%x'.\n", - -optopt); + print_help(); + return 1; + } else { + printf ( "Unknown option character `\\x%x'.\n", optopt); + print_help(); return 1; - default: - abort (); + } + break; + default: + abort (); } if (mvalue == NULL || cvalue == NULL || pvalue == NULL || fvalue == NULL) { - printf("options -m, -c, -p and -f required.\n"); + printf("options -m, -c, -p and -f are required.\n"); printf("usage: %s -m maxlatency -c cycles_per_packet -p mpps(million-packet-per-sec) -f tsc_freq_mhz [-t timeout (in secs)] [-q min_queue_len_to_print_trace]\n", argv[0]); return 1; }