From patchwork Wed Jun 5 16:06:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 165903 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7548070ili; Wed, 5 Jun 2019 09:06:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqx90MUxEO3Ajeqyvg98wgaSG+0jdcdVEjelThpMS95tZElx1pq4vCAqrEK3oQwaQvFKcIWQ X-Received: by 2002:a65:6256:: with SMTP id q22mr5492387pgv.190.1559750796553; 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=uJ4qZcTwSd95ubDhY73EULqJfKmjYmv3noJD7KeHs3L/XO6QhX0z0X7wo30vDBw2Mn w5Pi7Lh5hyIUJ22ZTUElcmD/EYdU8BGagbAhii2dJEFG/0cbLgL5JF4EiFwu3agsqhCe W0U9gqsIhGCv1rJMrGbRVVmN+H+u3nsgn3+E0ssXSZR5lhHkvzExVDz4wtHI4ijzCSbu DU3w8m+GUoesPCtXq8+ZECOMAetYxbcJ+KTaaFSfJQimcDd1UL0a7b/eUvy1B9qwhXfz xI8DJ7brQ5cWjcaGu/EYYA9LVBwihCcxlxilsEcmGHhaB91EjZ7O9/4bpxsyO+kl/RTp h8ag== 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=Hofr8rpd4HgioQGQW9rIyal0b/V5xOUL/A/mQeWjHW0=; b=yiBWZDbpyE84yDU3Y6qfZcFPaPh2IvbMM/3VLBDXEKmi3kFMk2b4+vS7qouNj6SeuK BIVFZ7Il7AG0fB0QfBe4KHPfUU8u1wQxlShQmkT5PntijhPj7QiSnOEcJO1vdgJ/yoHD vW7rTE4he+TGKOvJQEVrUESPlXoPpEnJqbGAucPtLc3u2FK/29SEjUfzO49FG2SMvbWr amzk5ws042vJ4PFttPrD5Sq8kwOcYtvLHFKw7IcK+BhHSLbehMutthZrbhngcayZ5nUI xSjmaDT3m4OGXkdAbzsk1egWeCLv6ejThT6emkTPSMPc/CvJIRAGxDRelnCloL1xJMN3 lFVQ== 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 S1728448AbfFEQGb (ORCPT + 3 others); Wed, 5 Jun 2019 12:06:31 -0400 Received: from mail.monom.org ([188.138.9.77]:35590 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726421AbfFEQGb (ORCPT ); Wed, 5 Jun 2019 12:06:31 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id 5DC9D500535; Wed, 5 Jun 2019 18:06:29 +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 20ED55004BB; Wed, 5 Jun 2019 18:06:28 +0200 (CEST) From: Daniel Wagner To: John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH v2 01/12] rt_numa.h: Remove unused function Date: Wed, 5 Jun 2019 18:06:06 +0200 Message-Id: <20190605160617.22987-2-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 From: Daniel Wagner GCC on a BeagleBoneBlack complains: In file included from src/cyclictest/cyclictest.c:39:0: src/cyclictest/rt_numa.h:253:13: warning: ‘numa_on_and_available’ defined but not used [-Wunused-function] static void numa_on_and_available() ^~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Daniel Wagner --- src/cyclictest/rt_numa.h | 7 ------- 1 file changed, 7 deletions(-) -- 2.20.1 Signed-off-by: John Kacur diff --git a/src/cyclictest/rt_numa.h b/src/cyclictest/rt_numa.h index e8cd7f481baa..e0f4b2e9d8b2 100644 --- a/src/cyclictest/rt_numa.h +++ b/src/cyclictest/rt_numa.h @@ -249,13 +249,6 @@ static inline void rt_bitmask_free(struct bitmask *mask) free(mask); } - -static void numa_on_and_available() -{ - if (numa) /* NUMA is not defined here */ - fatal("numa mode and numa functions not available.\n"); -} - #endif /* NUMA */ /* From patchwork Wed Jun 5 16:06:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 165909 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7548112ili; Wed, 5 Jun 2019 09:06:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzR4PhdD0332rn/PuO71EnG7+atFykq/2k4mcbcTVvAbl4wiSgFPyo4mAEbxjwkGzp2iyQ4 X-Received: by 2002:a63:224c:: with SMTP id t12mr5544854pgm.227.1559750797950; Wed, 05 Jun 2019 09:06:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559750797; cv=none; d=google.com; s=arc-20160816; b=lqdhvU1tNMB/c/DpNpqNVvCdC2m//Viydh1iPM+RUDxw4WDTPUphBuKSP5ThEPHQlW ok/xh9k67nApCm4BQxMbidn+z8J2Kv93hdT4S0kTjuQl/etD5AVljGdoMO69b/oU6E7o E5xb0zS9jGMWaQGV54i2WnUjlgciIv+s/8yomfsiaengEC4p992ZqeJztV8+A/2bPSBf iqC8/fIHv+NW8s3dFFYzVS4fw+Ve7iDALuSEVaNlOhvJ4bw0DKS2J+L3VYiaiTaZLcCG wDiiGRr9cHFHzu84RqKk//FkYpm94lFenmv7jtn+oQrDV89Gfjz3JtZu6jKsn7eOZauW Pfhg== 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=ZBvLSRPu/cNRLg804NC/Ip05OvKFXTJDrvLs7Usw6fo=; b=VPDdSK1RdG3rC+HAkFoGmEMYSaUijMuBOmBOtALt2HJOgn0oRXBoLyNL3LprJQwUPZ OQ4NGDCwCoi9c/wv5nTXcAZXVtjg/YmPdgKU1ezdHwA1pi1ZIlrLmjkbOjOxyKiYl2Oj MZX5zA3MHYUS+FoFexJCPMM0NYkVzsrjVby1CtXmEyeDaxodhobhe0WKsh9L9c9wWqJX WRMRh4OjVv20VtsyPWrFEySRsAOl+w1mU+8q4XH8uyGuFwEzbCDYQQuiY+fzfvMPzKIy +Dz2OfyWpXJmZPTBN9CAyDDMV97272EW9eA+hOgxHo1FCzU9+sUHZYVN5hM2VWYo4Rj1 7d1A== 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.37; Wed, 05 Jun 2019 09:06:37 -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 S1728624AbfFEQGg (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 S1726829AbfFEQGc (ORCPT ); Wed, 5 Jun 2019 12:06:32 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id 28F3E5006C0; Wed, 5 Jun 2019 18:06:30 +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 E54EA5004BB; Wed, 5 Jun 2019 18:06:29 +0200 (CEST) From: Daniel Wagner To: John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH v2 02/12] queuelat: Use clock syscall for ARM 32 bit Date: Wed, 5 Jun 2019 18:06:07 +0200 Message-Id: <20190605160617.22987-3-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 CPUs such as Cortex-M8 don't have a rdtsc instruction. Fallback using a syscall. Signed-off-by: Daniel Wagner --- src/queuelat/queuelat.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) -- 2.20.1 Signed-off-by: John Kacur diff --git a/src/queuelat/queuelat.c b/src/queuelat/queuelat.c index 3b291f168768..a5525e41776a 100644 --- a/src/queuelat/queuelat.c +++ b/src/queuelat/queuelat.c @@ -7,6 +7,7 @@ #include #include #include +#include #define NSEC_PER_SEC 1000000000 @@ -249,6 +250,8 @@ typedef unsigned long long cycles_t; typedef unsigned long long usecs_t; typedef unsigned long long u64; +#if defined __x86_64__ || defined __i386__ + #ifdef __x86_64__ #define DECLARE_ARGS(val, low, high) unsigned low, high #define EAX_EDX_VAL(val, low, high) ((low) | ((u64)(high) << 32)) @@ -270,7 +273,25 @@ static inline unsigned long long __rdtscll(void) return EAX_EDX_VAL(val, low, high); } -#define rdtscll(val) do { (val) = __rdtscll(); } while (0) +#define gettick(val) do { (val) = __rdtscll(); } while (0) + +#elif defined __arm__ + +static inline unsigned long long __clock_gettime(void) +{ + struct timespec now; + int ret; + + ret = clock_gettime(CLOCK_MONOTONIC, &now); + if (ret < 0) + return 0; + + return now.tv_nsec; +} + +#define gettick(val) do { (val) = __clock_gettime(); } while (0) + +#endif static void init_buckets(void) { @@ -348,9 +369,9 @@ static void run_n(int n) memmove(dest, src, n); for (i = 0; i < loops; i++) { - rdtscll(b); + gettick(b); memmove(dest, src, n); - rdtscll(a); + gettick(a); delta = (a - b) * cycles_to_ns; account(delta); } @@ -446,9 +467,9 @@ void main_loop(void) int ret; int nr_packets_fill; - rdtscll(b); + gettick(b); memmove(dest, src, default_n); - rdtscll(a); + gettick(a); delta = (a - b) * cycles_to_ns; account(delta); From patchwork Wed Jun 5 16:06:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 165904 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7548096ili; Wed, 5 Jun 2019 09:06:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlb2RYlJEmr2RtMD5hVZuIwBV607MICzG10mekYObFTVH7AukEJfOQ/UVWoYVEfNgb0tQ/ X-Received: by 2002:a63:ef56:: with SMTP id c22mr5481847pgk.13.1559750797243; Wed, 05 Jun 2019 09:06:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559750797; cv=none; d=google.com; s=arc-20160816; b=s1Bx7UcWFe0ODEe0GQr1u5q7ZI/4iZv5L2BGh4B5jfSu7RSjnFkbwd8h/cTmQxFlS8 Qoz7ZMxLqQwACNhocPZrk5p4WIs4ISRzzgn/9gGFYW79aG7RN7g0gG+Sjk4ZnDtGBHMX wmCDUf+LIK/m/dJK93cR/3B1596uAsMizCgEQx3bhlHdLrgS8B6ZUT6fMm6RWGY3dtyj FrkBqf274c+CBo/0zIIo7J2ZbE38R3nfGdJHlxlI615uACggDPEjxAktlj932YvWzgsG yS8zqZK050UtAwKzpY0y8IJWXUB158CgffSwzbxQszgjXaChZ0LrwGM6xWbbKauGdkXX WgbQ== 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=3qDgzuTBM+uw6b7rn9cS2fL/vWiODGNhhGkSVKX58/8=; b=iH78dJdEfAhEAD/Rq5e/6U/0Pjgl5q7Qu07k0GxP3JfHCm6lTo4GzbYWLAQpu8Vuvi LKV1p4w8YPGX7Ul5k2t69sRh1aV9/njjUtIfeRDrjeIr/j6yCBrII/kz7KYmgDdiuOHM UO7iPnIF2myQAmC6ZD5M1JQoRcSNCsL66LdMv6JdCR7eCssVB0YoDZIzmoZem5ltovC3 vpQQKsfmmAdBz6CPzU2P5E8NUtNRTRDAuS56jaOwnEFy4GiGowFtwSxDOrK5QO0ZurYX 07/diaCjLerrAx3+QWz7gm20S0TrvSGZrSjeYsmnimcSic/vXD2d/RJii9vA9SuHu4GP f8Bg== 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:37 -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 S1728593AbfFEQGg (ORCPT + 3 others); Wed, 5 Jun 2019 12:06:36 -0400 Received: from mail.monom.org ([188.138.9.77]:35608 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726421AbfFEQGc (ORCPT ); Wed, 5 Jun 2019 12:06:32 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id EE026500709; Wed, 5 Jun 2019 18:06:30 +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 B20115004BB; Wed, 5 Jun 2019 18:06:30 +0200 (CEST) From: Daniel Wagner To: John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH v2 03/12] rt-utils: Move parse_time_string() Date: Wed, 5 Jun 2019 18:06:08 +0200 Message-Id: <20190605160617.22987-4-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 Move parse_time_string() to rt-utils.c so we can re use it. Signed-off-by: Daniel Wagner --- src/cyclictest/cyclictest.c | 33 --------------------------------- src/include/rt-utils.h | 2 ++ src/lib/rt-utils.c | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 33 deletions(-) -- 2.20.1 Signed-off-by: John Kacur diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c index ed59edefbf97..03d56e4f520c 100644 --- a/src/cyclictest/cyclictest.c +++ b/src/cyclictest/cyclictest.c @@ -406,39 +406,6 @@ static void enable_trace_mark(void) open_tracemark_fd(); } -/* - * parse an input value as a base10 value followed by an optional - * suffix. The input value is presumed to be in seconds, unless - * followed by a modifier suffix: m=minutes, h=hours, d=days - * - * the return value is a value in seconds - */ -static int parse_time_string(char *val) -{ - char *end; - int t = strtol(val, &end, 10); - if (end) { - switch (*end) { - case 'm': - case 'M': - t *= 60; - break; - - case 'h': - case 'H': - t *= 60*60; - break; - - case 'd': - case 'D': - t *= 24*60*60; - break; - - } - } - return t; -} - /* * Raise the soft priority limit up to prio, if that is less than or equal * to the hard limit diff --git a/src/include/rt-utils.h b/src/include/rt-utils.h index ef0f6acf4ab5..405fa7855346 100644 --- a/src/include/rt-utils.h +++ b/src/include/rt-utils.h @@ -24,4 +24,6 @@ uint32_t string_to_policy(const char *str); pid_t gettid(void); +int parse_time_string(char *val); + #endif /* __RT_UTILS.H */ diff --git a/src/lib/rt-utils.c b/src/lib/rt-utils.c index ac6878ccacf1..e1b166afcd6c 100644 --- a/src/lib/rt-utils.c +++ b/src/lib/rt-utils.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -320,3 +321,36 @@ pid_t gettid(void) { return syscall(SYS_gettid); } + +/* + * parse an input value as a base10 value followed by an optional + * suffix. The input value is presumed to be in seconds, unless + * followed by a modifier suffix: m=minutes, h=hours, d=days + * + * the return value is a value in seconds + */ +int parse_time_string(char *val) +{ + char *end; + int t = strtol(val, &end, 10); + if (end) { + switch (*end) { + case 'm': + case 'M': + t *= 60; + break; + + case 'h': + case 'H': + t *= 60*60; + break; + + case 'd': + case 'D': + t *= 24*60*60; + break; + + } + } + return t; +} From patchwork Wed Jun 5 16:06:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 165907 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7548102ili; Wed, 5 Jun 2019 09:06:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkiA/5MYp+pKbJKEPblg9xVEGoOudmr7gqDbtu5w5L9x1u/tadr671qJYWaAr/AVYTd/Zp X-Received: by 2002:a17:90a:ac0e:: with SMTP id o14mr33025119pjq.142.1559750797578; Wed, 05 Jun 2019 09:06:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559750797; cv=none; d=google.com; s=arc-20160816; b=Ow4c/L3/DPk9vaIfLeN0V0WuU1zme+5tti9ViYMvCA8TCmoMNET1HpYCcjViDng1wK jNDkw0ZUil7Tp+GBFuWo1iH9IaoJY6jeYqvABR2O/3qZBvNzExIP7nYg4Of3qa5Hl1Za Rq6BeJ7hLXhjojEmUhcAFFW5q5QlJYbnAaLEVwL7dkA4WTJNO0gO2SP1dhh2rCNjWLnA N8KyAfAt5Z+fX1f/W2kMJdUOOMqNB3DJhbDQ93cJhmALgL2/AYQbaNymAhr6QPwaptyz FiTFR/+izsP57bmQhRf0s2GeG2MFfXj/7nw00CDeAPdkQR/Sh/X7Pk06R9MaKDVcrJ+4 lheA== 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=uOuXN/teordWKBedjbLhio+PxHj002XmoCaMPQy3kDs=; b=XdkvKWvF9tMkWrye+ox+VVLpS8ufBn9x9iUiI000b3BLLCazEKEFBHsxSHT11R4n0K rUJ9Paug6ddesCQNc+apGZr4DQ87A3TNs6S4jrWBGJW+4jMwicxJLwB4bIEQC9oNKlOg IKgOdsrHLCXX5Wuk8ZcYc5CRV9W88cuRYdkyjzWjqHo2idc+3C0XjrZ4G5G99qm74nMj qEjHIYpUqYuNlaZv+Z6axXXEvULecgiXC1YpRQiZbTSn3iqA7+nZ0phjWkFDNflyWOW7 WvPUS9vhmLdISiTgn/yYvxv9/AL9JPFFM6i5N8Ec5reS7B872B1XfXeawGpaINs/UT9G ZrAQ== 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.37; Wed, 05 Jun 2019 09:06:37 -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 S1728596AbfFEQGg (ORCPT + 3 others); Wed, 5 Jun 2019 12:06:36 -0400 Received: from mail.monom.org ([188.138.9.77]:35618 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728560AbfFEQGd (ORCPT ); Wed, 5 Jun 2019 12:06:33 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id C2D1B50081F; Wed, 5 Jun 2019 18:06:31 +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 820745004BB; Wed, 5 Jun 2019 18:06:31 +0200 (CEST) From: Daniel Wagner To: John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH v2 04/12] pi_stress: Allow short command line arguments Date: Wed, 5 Jun 2019 18:06:09 +0200 Message-Id: <20190605160617.22987-5-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 Add optstring to getopt_long() command line parser to support the short options as it documented in the man page and also in the usage help text. Signed-off-by: Daniel Wagner --- src/pi_tests/pi_stress.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.20.1 Signed-off-by: John Kacur diff --git a/src/pi_tests/pi_stress.c b/src/pi_tests/pi_stress.c index ac7646cd2613..543106be8e18 100644 --- a/src/pi_tests/pi_stress.c +++ b/src/pi_tests/pi_stress.c @@ -1322,9 +1322,8 @@ int process_sched_line(const char *arg) void process_command_line(int argc, char **argv) { int opt; - while ((opt = getopt_long(argc, argv, "+", options, NULL)) != -1) { + while ((opt = getopt_long(argc, argv, "+ht:vqi:g:rs:pdVum", options, NULL)) != -1) { switch (opt) { - case '?': case 'h': usage(); exit(0); 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; From patchwork Wed Jun 5 16:06:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 165910 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7548115ili; Wed, 5 Jun 2019 09:06:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4amSOIF/lHHkZw65PTQsTKg1nih6jCzagxNlZb+NSBCXbUXBFy8zi+OOblPdmtURTHnJY X-Received: by 2002:a17:902:e301:: with SMTP id cg1mr25680302plb.184.1559750798281; Wed, 05 Jun 2019 09:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559750798; cv=none; d=google.com; s=arc-20160816; b=MgdztFqSG6+Sw6qztiSdSopp4uP23vVKRf2pZaRlemu/VPYHdqw9IgWq/dHiistzTp IFrUYKWDkAKzGOo4BdOBbK07FEZQZ35NJ58SVaBFAbRRZPOBvzK312pOCqDD6cUCKTWG KDW9u5VeKiTqtAShCuaLoN6NGwTlXASc/PPJ34A614VfqFh8vzcbT8lifgIwZlZeIcq+ H+fuBwf0eNIe1khpzVgydHy0Iou7QeRw5WlBHtfLE6sM6rW1znouTiXuNzPodtH3y/wN 8igKnsuMLElqHEIjWh3+OQVeO3vS9UoBDEuyoXgHlKLFU0aHQxEngBEmNpXEjLIXUsyr fM9w== 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=O2AsXPacOPq2MlOCLv9ucstIt/wgBhaf6HM7ekPRgDk=; b=RExv+xLigi7plA/+x5ww0ItXGVSeDOZ4kS54DrRdrndXtuOxvgZNQ/PqADby3WOqIJ +sH0BQgqvhXrcSFIku2NJtWxi5ttiw28ul+w5iwM1MSjMPFAlYFxpm5Kpygbiqdns3xB 4ZejNIGToyStzJG7K99Qa8rtCoUfOGivihjN5am1ncx3ImvulgkWJ1AGigDlIcPh5R/D RcPe7IfeoW3sCOJXQ7wjJEX3HEm0KTug21znWxOOGNzjEnW7NwXZdFq6Lx2Gfz8HDNIH pkZMXlFPy+NvH0f4giVKZk5hRqnb8g1Vh3WJ4B+xAz31MSgZfCf5o2K2wtJjIhTnboAR h1Fw== 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.38; Wed, 05 Jun 2019 09:06:38 -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 S1728633AbfFEQGh (ORCPT + 3 others); Wed, 5 Jun 2019 12:06:37 -0400 Received: from mail.monom.org ([188.138.9.77]:35608 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728523AbfFEQGg (ORCPT ); Wed, 5 Jun 2019 12:06:36 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id 65DFF50093C; Wed, 5 Jun 2019 18:06:33 +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 276675004BB; Wed, 5 Jun 2019 18:06:33 +0200 (CEST) From: Daniel Wagner To: John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH v2 06/12] pmqtest: Add duration command line argument Date: Wed, 5 Jun 2019 18:06:11 +0200 Message-Id: <20190605160617.22987-7-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 Many of the test programs have the --loop argument for automatic stopping. The main problem with the --loop argument is how long is --loop 1000? To simplify automated tests introduce a --duration argument which allows to set the time how long a test should run. This allows the test suite to define the execution time and also the timeout which a normal human can understand. For example run the test for 10 minutes and timeout at 11 minutes: # timeout 11m pmqtest -D 10m Signed-off-by: Daniel Wagner --- src/pmqtest/pmqtest.8 | 5 +++++ src/pmqtest/pmqtest.c | 17 +++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) -- 2.20.1 Signed-off-by: John Kacur diff --git a/src/pmqtest/pmqtest.8 b/src/pmqtest/pmqtest.8 index 05421e01e70b..9108a939b9f7 100644 --- a/src/pmqtest/pmqtest.8 +++ b/src/pmqtest/pmqtest.8 @@ -21,6 +21,11 @@ It is useful to track down unexpected large latencies of a system. .B \-d, \-\-distance=DIST Set the distance of thread intervals in microseconds (default is 500 us). When pmqtest is called with the -t option and more than one thread is created, then this distance value is added to the interval of the threads: Interval(thread N) = Interval(thread N-1) + DIST .TP +.B \-D, \-\-duration=TIME +Specify a length for the test run. +.br +Append 'm', 'h', or 'd' to specify minutes, hours or days. +.TP .B \-f, \-\-forcetimeout=TO Set an artificial delay of the send function to force timeout of the receiver, requires the -T option .TP diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c index 75d5ee8185a0..054768d161a7 100644 --- a/src/pmqtest/pmqtest.c +++ b/src/pmqtest/pmqtest.c @@ -252,6 +252,8 @@ static void display_help(void) "-f TO --forcetimeout=TO force timeout of mq_timedreceive(), requires -T\n" "-i INTV --interval=INTV base interval of thread in us default=1000\n" "-l LOOPS --loops=LOOPS number of loops: default=0(endless)\n" + "-D --duration=TIME specify a length for the test run.\n" + " Append 'm', 'h', or 'd' to specify minutes, hours or days.\n" "-p PRIO --prio=PRIO priority\n" "-S --smp SMP testing: options -a -t and same priority\n" " of all threads\n" @@ -271,6 +273,7 @@ static int tracelimit; static int priority; static int num_threads = 1; static int max_cycles; +static int duration; static int interval = 1000; static int distance = 500; static int smp; @@ -293,6 +296,7 @@ static void process_options (int argc, char *argv[]) {"forcetimeout", required_argument, NULL, 'f'}, {"interval", required_argument, NULL, 'i'}, {"loops", required_argument, NULL, 'l'}, + {"duration", required_argument, NULL, 'D'}, {"priority", required_argument, NULL, 'p'}, {"smp", no_argument, NULL, 'S'}, {"threads", optional_argument, NULL, 't'}, @@ -300,7 +304,7 @@ static void process_options (int argc, char *argv[]) {"help", no_argument, NULL, '?'}, {NULL, 0, NULL, 0} }; - int c = getopt_long (argc, argv, "a::b:d:f:i:l:p:St::T:", + int c = getopt_long (argc, argv, "a::b:d:f:i:l:D:p:St::T:", long_options, &option_index); if (c == -1) break; @@ -325,6 +329,7 @@ static void process_options (int argc, char *argv[]) case 'f': forcetimeout = atoi(optarg); break; case 'i': interval = atoi(optarg); break; case 'l': max_cycles = atoi(optarg); break; + case 'D': duration = parse_time_string(optarg); break; case 'p': priority = atoi(optarg); break; case 'S': smp = 1; @@ -369,7 +374,10 @@ static void process_options (int argc, char *argv[]) if (forcetimeout && !timeout) error = 1; - + + if (duration < 0) + error = 1; + if (priority && smp) sameprio = 1; @@ -418,10 +426,15 @@ int main(int argc, char *argv[]) sigemptyset(&sigset); sigaddset(&sigset, SIGTERM); sigaddset(&sigset, SIGINT); + sigaddset(&sigset, SIGALRM); pthread_sigmask(SIG_SETMASK, &sigset, NULL); signal(SIGINT, sighand); signal(SIGTERM, sighand); + signal(SIGALRM, sighand); + + if (duration) + alarm(duration); receiver = calloc(num_threads, sizeof(struct params)); sender = calloc(num_threads, sizeof(struct params)); From patchwork Wed Jun 5 16:06:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 165908 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7548141ili; Wed, 5 Jun 2019 09:06:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzksnQpMu1neUvF1bQKDXQduZFROqZNTtQzntnb+7CoNjtxOD4zK87zmwVSHs2U71VP7qEb X-Received: by 2002:a17:902:20ec:: with SMTP id v41mr42381281plg.142.1559750799396; Wed, 05 Jun 2019 09:06:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559750799; cv=none; d=google.com; s=arc-20160816; b=lb1P45QdMXprL8RvqQMs0H4NBog+IemuxzxxiIvN9Xtd92mFNpuQRbjoGrQWiPuDki 9N575emcLkgebgeVwF2wSnrLTxBF79QsG4COpUqr8e85NPIwAiuE/ozRKSa4/Rp3vkcf DZzrfz7xXBqqE0CTbKeiUWC6Moywa00cphhUdVmOSZaHqb9A92Z4EtDWyzVlo32sQkSH tWUh3/Exmr55o2sxczGGz4xufo2Km/DiPRDaR6fqUcw944uy9SncSSPDFUKC6WYdPRIv ILds3uWdyfyakwuCNpRaEuJ74HRE6DILqpUCoczCbyOUalp+puSXPEsNCYghA4zAV1ye /S+g== 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=wnJI31piqJwKTtuV00m3qSrgsnbmH7xKuBIrXb0rP9A=; b=vD7A+VOtWaX9LPWijflgZ9UsezbgjwcfRqPQD4ZIVaNT5ymbdZevUeWRfnZ4c5Bhoo lf+XvqtuHHzMNN3gvbY+jXDWq3VBN2sLEQS0+zhvtgVGhelzlsFyfnEBSw3Ightm9RsJ dz7GhYN02SxgY5LY3wQpnpZ8KexBAO/LpwFybgxbgpuf5e/zEOLKejucy6HLfplFV4dN v9apWWEHwnRfA82fPbtZdkYO6NnHBiBaCjd4hDvtv1cZLXgr0Yq4kAPOgsE6yOpcMDJy 2+BmPATdqLE7d4Xgx41T64W93eUc0SkUCxitcpahxPFzfvpa8VBPSxcTu2ttSoewosgL A5EQ== 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.39; Wed, 05 Jun 2019 09:06:39 -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 S1728576AbfFEQGh (ORCPT + 3 others); Wed, 5 Jun 2019 12:06:37 -0400 Received: from mail.monom.org ([188.138.9.77]:35618 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728591AbfFEQGg (ORCPT ); Wed, 5 Jun 2019 12:06:36 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id 36E395004BB; Wed, 5 Jun 2019 18:06:34 +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 EE2F250094D; Wed, 5 Jun 2019 18:06:33 +0200 (CEST) From: Daniel Wagner To: John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH v2 07/12] ptsematest: Add duration command line argument Date: Wed, 5 Jun 2019 18:06:12 +0200 Message-Id: <20190605160617.22987-8-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 Many of the test programs have the --loop argument for automatic stopping. The main problem with the --loop argument is how long is --loop 1000? To simplify automated tests introduce a --duration argument which allows to set the time how long a test should run. This allows the test suite to define the execution time and also the timeout which a normal human can understand. For example run the test for 10 minutes and timeout at 11 minutes: # timeout 11m ptsematest -D 10m Signed-off-by: Daniel Wagner --- src/ptsematest/ptsematest.8 | 5 +++++ src/ptsematest/ptsematest.c | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/src/ptsematest/ptsematest.8 b/src/ptsematest/ptsematest.8 index 9d835337ec27..289f3a1d7ae8 100644 --- a/src/ptsematest/ptsematest.8 +++ b/src/ptsematest/ptsematest.8 @@ -21,6 +21,11 @@ It is useful to track down unexpected large latencies of a system. .B \-d, \-\-distance=DIST Set the distance of thread intervals in microseconds (default is 500 us). When cyclictest is called with the -t option and more than one thread is created, then this distance value is added to the interval of the threads: Interval(thread N) = Interval(thread N-1) + DIST .TP +.B \-D, \-\-duration=TIME +Specify a length for the test run. +.br +Append 'm', 'h', or 'd' to specify minutes, hours or days. +.TP .B \-i, \-\-interval=INTV Set the base interval of the thread(s) in microseconds (default is 1000 us). This sets the interval of the first thread. See also -d. .TP diff --git a/src/ptsematest/ptsematest.c b/src/ptsematest/ptsematest.c index a31c745ec928..6bedbc81b572 100644 --- a/src/ptsematest/ptsematest.c +++ b/src/ptsematest/ptsematest.c @@ -173,6 +173,8 @@ static void display_help(void) "-d DIST --distance=DIST distance of thread intervals in us default=500\n" "-i INTV --interval=INTV base interval of thread in us default=1000\n" "-l LOOPS --loops=LOOPS number of loops: default=0(endless)\n" + "-D --duration=TIME specify a length for the test run.\n" + " Append 'm', 'h', or 'd' to specify minutes, hours or days.\n" "-p PRIO --prio=PRIO priority\n" "-S --smp SMP testing: options -a -t and same priority\n" " of all threads\n" @@ -190,6 +192,7 @@ static int tracelimit; static int priority; static int num_threads = 1; static int max_cycles; +static int duration; static int interval = 1000; static int distance = 500; static int smp; @@ -209,13 +212,14 @@ static void process_options (int argc, char *argv[]) {"distance", required_argument, NULL, 'd'}, {"interval", required_argument, NULL, 'i'}, {"loops", required_argument, NULL, 'l'}, + {"duration", required_argument, NULL, 'D'}, {"priority", required_argument, NULL, 'p'}, {"smp", no_argument, NULL, 'S'}, {"threads", optional_argument, NULL, 't'}, {"help", no_argument, NULL, '?'}, {NULL, 0, NULL, 0} }; - int c = getopt_long (argc, argv, "a::b:d:i:l:p:St::", + int c = getopt_long (argc, argv, "a::b:d:i:l:D:p:St::", long_options, &option_index); if (c == -1) break; @@ -239,6 +243,7 @@ static void process_options (int argc, char *argv[]) case 'd': distance = atoi(optarg); break; case 'i': interval = atoi(optarg); break; case 'l': max_cycles = atoi(optarg); break; + case 'D': duration = parse_time_string(optarg); break; case 'p': priority = atoi(optarg); break; case 'S': smp = 1; @@ -280,6 +285,9 @@ static void process_options (int argc, char *argv[]) if (num_threads < 1) error = 1; + if (duration < 0) + error = 1; + if (priority && smp) sameprio = 1; @@ -317,6 +325,10 @@ int main(int argc, char *argv[]) signal(SIGINT, sighand); signal(SIGTERM, sighand); + signal(SIGALRM, sighand); + + if (duration) + alarm(duration); receiver = calloc(num_threads, sizeof(struct params)); sender = calloc(num_threads, sizeof(struct params)); From patchwork Wed Jun 5 16:06:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 165906 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7548128ili; Wed, 5 Jun 2019 09:06:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdNxVDmdAlDoVPMwu/9Eb0ZIcGkIElYd4jY4bNC4BFxchOpmofuFnNm8f1hft9MF3MD/2l X-Received: by 2002:a17:90a:af8b:: with SMTP id w11mr45329764pjq.135.1559750798667; Wed, 05 Jun 2019 09:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559750798; cv=none; d=google.com; s=arc-20160816; b=i1jJR7YTlsenaWmkUDsJ8jWS3AN3HwXOIQEJAK0i/xm3lM/Vi7zrJ82mDLfhHGLsxp rkFS4BY8bAWHGUFRqS0+FlPPdo2dtzZbIjKmLyf5x9Ene7h5j4jAvUm1l7Dgf3TcmOSU tUbPSxaxMhpjbUZrzupq97o2oOLJi8HZU8LIl6kYl9Rks1QpYVN8dVRR/2B4jpsS5qnl dczGACEfSiMqCR9R3WCyBFlnWJ57qALLGOXva2HuEtMq4TJlbOc4zd2PtNCBMMMJNnCp vrvZF+m7/v1+LNIyyEi1IkDOuoT4+QTPK+aNzXaSjYAOZ2HNFYP545bhBoGl1S1vwdJs yZ4A== 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=Iiemsgz3cTwcb8zhtBiXVjPX1yTZS1km0vGJBbjXcy0=; b=rPY+edlyYmCX3sfGjawuybgbfYpMUrvt9A3GW19cnEbtomV01LCSaXYvG+gE69wmlb qrmLTITOrAIMhMCPFJLk2sF3Ijr2Szf/7yPUNg259Sd5EDtgvUALyum/YGvwcnT9yzAT SywRZdNTvzcQ21CAXA9qTvC+sQb4XejQpCdKOwzHEVwv6Tk+uXJsmosyAvc69dJji3bC cU/aBg6dPRPg4YqMcK4MHJaA9Ut5GI9wM1lwmo5pUxa0wwlwe76x7iLrU+0ksyLdWUTR w4nEPuX8Il9IwDjOZlTpFVNj/RJArhxW0ndKw7g6iCzi25VcLVMOkGgRaTiLUrhOicN9 hzsg== 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.38; Wed, 05 Jun 2019 09:06:38 -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 S1728647AbfFEQGh (ORCPT + 3 others); Wed, 5 Jun 2019 12:06:37 -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 S1728534AbfFEQGg (ORCPT ); Wed, 5 Jun 2019 12:06:36 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id 0B00250094D; Wed, 5 Jun 2019 18:06:35 +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 C27D0500959; Wed, 5 Jun 2019 18:06:34 +0200 (CEST) From: Daniel Wagner To: John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH v2 08/12] cyclicdeadline: Add duration command line argument Date: Wed, 5 Jun 2019 18:06:13 +0200 Message-Id: <20190605160617.22987-9-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 Many of the test programs have the --loop argument for automatic stopping. The main problem with the --loop argument is how long is --loop 1000? To simplify automated tests introduce a --duration argument which allows to set the time how long a test should run. This allows the test suite to define the execution time and also the timeout which a normal human can understand. For example run the test for 10 minutes and timeout at 11 minutes: # timeout 11m cyclicdeadline -D 10m Signed-off-by: Daniel Wagner --- src/sched_deadline/cyclicdeadline.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- 2.20.1 Signed-off-by: John Kacur Signed-off-by: John Kacur diff --git a/src/sched_deadline/cyclicdeadline.c b/src/sched_deadline/cyclicdeadline.c index 6d461b27ac43..47892daf747b 100644 --- a/src/sched_deadline/cyclicdeadline.c +++ b/src/sched_deadline/cyclicdeadline.c @@ -21,6 +21,8 @@ #include #include +#include + #ifdef __i386__ #ifndef __NR_sched_setattr #define __NR_sched_setattr 351 @@ -1049,6 +1051,7 @@ int main (int argc, char **argv) unsigned int interval = 1000; unsigned int step = 500; int percent = 60; + int duration = 0; u64 runtime; u64 start_period; u64 end_period; @@ -1062,7 +1065,7 @@ int main (int argc, char **argv) exit(-1); } - while ((c = getopt(argc, argv, "+hac:i:s:t:")) >= 0) { + while ((c = getopt(argc, argv, "+hac:i:s:t:D:")) >= 0) { switch (c) { case 'a': all_cpus = 1; @@ -1081,6 +1084,9 @@ int main (int argc, char **argv) case 't': nr_threads = atoi(optarg); break; + case 'D': + duration = parse_time_string(optarg); + break; case 'h': default: usage(argv); @@ -1246,6 +1252,10 @@ int main (int argc, char **argv) signal(SIGINT, sighand); signal(SIGTERM, sighand); + signal(SIGALRM, sighand); + + if (duration) + alarm(duration); if (!fail) loop(sched_data, nr_threads); From patchwork Wed Jun 5 16:06:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Wagner X-Patchwork-Id: 165911 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7548155ili; Wed, 5 Jun 2019 09:06:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhfl0qjhDvgcmCwv2oCgFD5E+aZ7aDWrr/3RYqQd/escDLSUWWEFZDtTU8ydVwY32v4ZTH X-Received: by 2002:a17:902:b94a:: with SMTP id h10mr44794211pls.265.1559750799719; Wed, 05 Jun 2019 09:06:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559750799; cv=none; d=google.com; s=arc-20160816; b=HH1cR9XDHzIW0MWbH3td76vLVc564b/KJw153qUbcN9yiMA1A1pg4reM7EgBTXG90s kgqmi07oRo7IDkM8CO3q1sA2mwBDnRIw6kc85K4Teaas0SHOIpARkpVMKKq+EeF66EGW FIxrjDpczkLhD0lvdI1ZI26yjE6+6JE3baFuOniTBB6YaXUxDCTx+YMeyHFoqk590uQC FdKaCvgG1hREwPJpiWIkWOByRV6RGBtwqbrvkJvdJegQbAMstR7MRr0DZvWfr8ZwDyAF 8CXOA3MhAjwtC83xUy2CO7LV5OxoQHKz/LYXxUQLhisYsSey4zNG4BmlgWG1ss+8rfTn Tkzg== 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=y8pf46kAQ6h2nG1I+qSEV0GfA/g0X8w6YruXz+zjpUk=; b=07eJ17ockAq7c/NVu1VRsISnTgvL2fO9DSjUTOeVq07tTQEiP13nw5ZvRzLYhyfsrR uBXCh/0vIxMOCyhu0oHURNd6sPyCThHByjRn59LE2IgszZm+QSbrswd72EqvzsdK4pZZ Rl0pjBe3/IfDkiTF+7buIw98K9cY5s/kMDS7FDVltPeJ0CEksS32RL7Yy/k5ZKCxKy0H rAVxiCujMqTmisZ+AUniaOkI8HXzJCOiY4XEKNOxjCmf5d+J6i4VF0EB5U54qwxx04lG 64F1tfuW41lkW4oXYXPDu0QXOLqbNxie1iJdbanxhy0vWipMrAnlKYolslrhiIFjmjbn zQGQ== 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.39; Wed, 05 Jun 2019 09:06:39 -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 S1728648AbfFEQGj (ORCPT + 3 others); Wed, 5 Jun 2019 12:06:39 -0400 Received: from mail.monom.org ([188.138.9.77]:35618 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728560AbfFEQGi (ORCPT ); Wed, 5 Jun 2019 12:06:38 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id D375F5009AE; Wed, 5 Jun 2019 18:06:35 +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 95A95500959; Wed, 5 Jun 2019 18:06:35 +0200 (CEST) From: Daniel Wagner To: John Kacur Cc: linux-rt-users@vger.kernel.org, Daniel Wagner Subject: [PATCH v2 09/12] signaltest: Add duration command line argument Date: Wed, 5 Jun 2019 18:06:14 +0200 Message-Id: <20190605160617.22987-10-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 Many of the test programs have the --loop argument for automatic stopping. The main problem with the --loop argument is how long is --loop 1000? To simplify automated tests introduce a --duration argument which allows to set the time how long a test should run. This allows the test suite to define the execution time and also the timeout which a normal human can understand. For example run the test for 10 minutes and timeout at 11 minutes: # timeout 11m signaltest -D 10m Signed-off-by: Daniel Wagner --- src/signaltest/signaltest.8 | 5 +++++ src/signaltest/signaltest.c | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) -- 2.20.1 Signed-off-by: John Kacur diff --git a/src/signaltest/signaltest.8 b/src/signaltest/signaltest.8 index 634d392a6da5..bd6ffe5c7a36 100644 --- a/src/signaltest/signaltest.8 +++ b/src/signaltest/signaltest.8 @@ -13,6 +13,11 @@ starting with two dashes ('\-\-'). .B \-b, \-\-breaktrace=USEC Send break trace command when latency > USEC .TP +.B \-D, \-\-duration=TIME +Specify a length for the test run. +.br +Append 'm', 'h', or 'd' to specify minutes, hours or days. +.TP .B \-l, \-\-loops=LOOPS Number of loops: default=0 (endless) .TP diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c index 59f979ec5ad1..a168191b7573 100644 --- a/src/signaltest/signaltest.c +++ b/src/signaltest/signaltest.c @@ -208,6 +208,8 @@ static void display_help(void) "signaltest \n\n" "-b USEC --breaktrace=USEC send break trace command when latency > USEC\n" "-l LOOPS --loops=LOOPS number of loops: default=0(endless)\n" + "-D --duration=TIME specify a length for the test run.\n" + " Append 'm', 'h', or 'd' to specify minutes, hours or days.\n" "-p PRIO --prio=PRIO priority of highest prio thread\n" "-q --quiet print a summary only on exit\n" "-t NUM --threads=NUM number of threads: default=2\n" @@ -221,6 +223,7 @@ static void display_help(void) static int priority; static int num_threads = 2; static int max_cycles; +static int duration; static int verbose; static int quiet; static int lockall = 0; @@ -235,6 +238,7 @@ static void process_options (int argc, char *argv[]) static struct option long_options[] = { {"breaktrace", required_argument, NULL, 'b'}, {"loops", required_argument, NULL, 'l'}, + {"duration", required_argument, NULL, 'D'}, {"priority", required_argument, NULL, 'p'}, {"quiet", no_argument, NULL, 'q'}, {"threads", required_argument, NULL, 't'}, @@ -243,13 +247,14 @@ static void process_options (int argc, char *argv[]) {"help", no_argument, NULL, '?'}, {NULL, 0, NULL, 0} }; - int c = getopt_long (argc, argv, "b:c:d:i:l:np:qrsmt:v", + int c = getopt_long (argc, argv, "b:c:d:i:l:D:np:qrsmt:v", long_options, &option_index); if (c == -1) break; switch (c) { case 'b': tracelimit = atoi(optarg); break; case 'l': max_cycles = atoi(optarg); break; + case 'D': duration = parse_time_string(optarg); break; case 'p': priority = atoi(optarg); break; case 'q': quiet = 1; break; case 't': num_threads = atoi(optarg); break; @@ -259,6 +264,9 @@ static void process_options (int argc, char *argv[]) } } + if (duration < 0) + error = 1; + if (priority < 0 || priority > 99) error = 1; @@ -340,6 +348,10 @@ int main(int argc, char **argv) signal(SIGINT, sighand); signal(SIGTERM, sighand); + signal(SIGALRM, sighand); + + if (duration) + alarm(duration); par = calloc(num_threads, sizeof(struct thread_param)); if (!par)