From patchwork Wed Jun 5 16:06:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 165905 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7548083ili; Wed, 5 Jun 2019 09:06:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzamBysBzBtZJ2LnXQTcjNBcnNjxTm3M+qmyyVIAKgvs/qoWUjH/ekMpgeGxr6+edMz+hJD X-Received: by 2002:a65:638a:: with SMTP id h10mr5677810pgv.64.1559750796917; Wed, 05 Jun 2019 09:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559750796; cv=none; d=google.com; s=arc-20160816; b=JmhsuckaMBo0JujNwHw7kY7XrVe9WwmfoZ5IENfoptLTZdLXZbPT4Je89wF2bqPtXA qlM+1fcj5fyNolvea0EC04nwuLji6HEQ7u5d8bDmrK28TYxkghJRO8ZCrib7yU4UWaRZ UFAN24Bw9HioJp31kkt4s05k8QEoDcqzVy0L6WoMOzf1zRwt9eKDrxrOD7EbvP3RMY6X XHYHII29KkK1zoLQmxPB1d/fMcKawtZo6iJAbtCWCelECBJVWWmN/ViRRKPX4DZYVr/O WSaKMkWD39zLdME0AsT8MCoa27TF6rSeiRItDvRjSCd8MMynxff+0VVurdUSiA8YuG4h HLgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9hy7QiKSYbqntk/3ks2AgehEEDTr0t7daM1Q4m/sAQ0=; b=M/3tJ3+101RkYb/Pmds5xWYXXSGtwXtV0nRMPVQB6dnyuxYyXdkhnrapi670RBK1qr f5Pv4+aWMsG83PMxwXTfWQl2/B3ZrB86yn3rvehx8cJu7RvIyy/F832Gd47sELX1ywyP RU7pttG2cEZ5XqvrMRJnAT/s78D8tzAU3nStZnFoRDTdPXT4H3rt7D+rkwuk7IR2kkUM 6WJORpbkPQHTTD84+24NbmAlnrM51VjhVlPxjhiyuplwS2w1ifZr4q0vhg6/OKffRuaX coJYHAuVHZ98kRHQHC+1TAgdhGYGIN36Q/yCd9pSh4P9Nvi8/59zk8+zPAVuqC7KjtL0 f1Nw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-rt-users-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-rt-users-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=monom.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q6si27364257pgm.101.2019.06.05.09.06.36; Wed, 05 Jun 2019 09:06:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-rt-users-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-rt-users-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-rt-users-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=monom.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728516AbfFEQGg (ORCPT + 3 others); Wed, 5 Jun 2019 12:06:36 -0400 Received: from mail.monom.org ([188.138.9.77]:35598 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728570AbfFEQGe (ORCPT ); Wed, 5 Jun 2019 12:06:34 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id 941B45008FD; Wed, 5 Jun 2019 18:06:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.monom.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (ppp-93-104-174-142.dynamic.mnet-online.de [93.104.174.142]) by mail.monom.org (Postfix) with ESMTPSA id 572B55004BB; Wed, 5 Jun 2019 18:06:32 +0200 (CEST) From: Daniel Wagner To: John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH v2 05/12] pi_stress: Rename -t command line option to -D Date: Wed, 5 Jun 2019 18:06:10 +0200 Message-Id: <20190605160617.22987-6-wagi@monom.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190605160617.22987-1-wagi@monom.org> References: <20190605160617.22987-1-wagi@monom.org> 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 Streamline the duration command line argument for all rt-tests. While at it also add man page. Signed-off-by: Daniel Wagner --- src/pi_tests/pi_stress.8 | 4 ++++ src/pi_tests/pi_stress.c | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) -- 2.20.1 Signed-off-by: John Kacur diff --git a/src/pi_tests/pi_stress.8 b/src/pi_tests/pi_stress.8 index c92b4bdf5609..475d3c34f135 100644 --- a/src/pi_tests/pi_stress.8 +++ b/src/pi_tests/pi_stress.8 @@ -57,6 +57,10 @@ seconds and then terminate. The number of inversion groups to run. Defaults to 10. .IP \-d|\-\-debug Run in debug mode; lots of extra prints +.IP "\-D, \-\-duration=TIME" +Specify a length for the test run. +.br +Append 'm', 'h', or 'd' to specify minutes, hours or days. .IP \-v|\-\-verbose Run with verbose messages .IP \-s|\-\-signal diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c index 543106be8e18..1286370c474b 100644 --- a/src/pi_tests/pi_stress.c +++ b/src/pi_tests/pi_stress.c @@ -146,7 +146,7 @@ int lockall = 0; /* command line options */ struct option options[] = { - {"duration", required_argument, NULL, 't'}, + {"duration", required_argument, NULL, 'D'}, {"verbose", no_argument, NULL, 'v'}, {"quiet", no_argument, NULL, 'q'}, {"groups", required_argument, NULL, 'g'}, @@ -1027,7 +1027,8 @@ void usage(void) printf("\t--verbose\t- lots of output\n"); printf("\t--quiet\t\t- suppress running output\n"); printf - ("\t--duration=- length of the test run in seconds [infinite]\n"); + ("\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", ngroups); printf @@ -1322,13 +1323,13 @@ int process_sched_line(const char *arg) void process_command_line(int argc, char **argv) { int opt; - while ((opt = getopt_long(argc, argv, "+ht:vqi:g:rs:pdVum", options, NULL)) != -1) { + while ((opt = getopt_long(argc, argv, "+hD:vqi:g:rs:pdVum", options, NULL)) != -1) { switch (opt) { case 'h': usage(); exit(0); - case 't': - duration = strtol(optarg, NULL, 10); + case 'D': + duration = parse_time_string(optarg); break; case 'v': verbose = 1;