From patchwork Fri Aug 18 23:23:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 110446 Delivered-To: patches@linaro.org Received: by 10.140.95.78 with SMTP id h72csp1532262qge; Fri, 18 Aug 2017 16:23:38 -0700 (PDT) X-Received: by 10.101.76.206 with SMTP id n14mr10030006pgt.154.1503098618064; Fri, 18 Aug 2017 16:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503098618; cv=none; d=google.com; s=arc-20160816; b=C9DQllVP6/KRqMaAU6Q5Ljx+INX2dwjUDLZzSPfyAr4W0oE71oMgwe2Hjv2QzxRFQT hgtpymZYTt7CTVXOvHMnYc+jO3M3+9//5o54knxFllymOLYmHnJ6+r9oPZnJmxPQ0ZAO AqxUQRbTQ9dBXi0R7EtDoLY5ZBPYj/EBcdsjIrGFnQFZtQV3oEOa8u1r7PvVJtaz5UQ4 uzgsu3aBHaNM8vJ8y6yDxFXVlalQ9hAQPV9f1WvhUGR6Rop57C57IEOmDFwNhCk3eYn+ FHBd4DziIcrqmcz+y7CkulOATv0nodkWnX6mYn7WGIiw4OGKuYsJOioUvqwxlCnCd0JJ WdoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=loAhQ3ToLcjqWRbq9Hsvhm5jDHBEAcJUhQ7cHO9W/UU=; b=Aao2yVreqU+ai0IXaWc6dOXgaHM1uqM9BK/pH8FDnq7ZH/NarBQqqdnkni1gK6T+8m GLdbUYefps6tNIVccP5lkS4Tk23oHvtI8ivn1l4zfAkOQCAYfkG2YMLRzpq5p6Jua+TK 9nERklcWmL5aZMDVR4mED7WuJabfS8x6PGe7eBcib8r/Ar5MxWA78prFqUghKNCPl9ba uU1K+fhfDipTo1xE4b3uZyxtOdKekQaW+cf+p+dSbQ58Va0s5+RNwK35Wg0kbFfpw+Yg qENIWw76c5jX1p0CvxfDDpKJlPLWDvPfLtnj6186k9jFS7eEW8HkPOgWrCAif2oykoQi dleQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mdm7Db7j; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::236 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-pg0-x236.google.com (mail-pg0-x236.google.com. [2607:f8b0:400e:c05::236]) by mx.google.com with ESMTPS id 62si4717824ple.143.2017.08.18.16.23.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Aug 2017 16:23:37 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::236 as permitted sender) client-ip=2607:f8b0:400e:c05::236; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mdm7Db7j; spf=pass (google.com: domain of john.stultz@linaro.org designates 2607:f8b0:400e:c05::236 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-pg0-x236.google.com with SMTP id q6so1756417pgs.2 for ; Fri, 18 Aug 2017 16:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=loAhQ3ToLcjqWRbq9Hsvhm5jDHBEAcJUhQ7cHO9W/UU=; b=Mdm7Db7jq9+VDofSxfwlJc96YGQ6hrfTlz2lxy+bBnPzc58Xe1YYlsreLovxxmqj28 zBA7CXzQFrWKxp0WfwXiPT3TJvarbeGOBLqNYu4CPHKcTyq/9KNRVDd6QUjWK76K4ctv GBLNHIYkdBrQZt23VHbZlXo6TrFxdCeAPPdag= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=loAhQ3ToLcjqWRbq9Hsvhm5jDHBEAcJUhQ7cHO9W/UU=; b=kl23qyYBibibKRER2ku9B+PMs00ahKOmhpIgU1kCr2oVg1YWCFn+Hz3VnaTupSOdz8 uS8fhmGmMrR1qRfZrIUUyxTuGJW51EJVzNWzxd/tWaZmLk5ZLM1QtB8vN36W9ou+BKzG /ZaQM2imswUWkpNAvTkCZjOKSYLwL78j6P6xHme2eWMFCi+VGdSQcE7W9ie2DKbTpyhK +ryMOhaChaJxqytLVcFo+YJY8aw/Pcbo9CmiH1lT36FglirB0JRMbJfyYML2IheXLOvv 1MfWeG/BG5XVL/0ByfaH+AJUVZATiuMkbv7JdPZmxZedUYlkr5V+D9WFceTiUw/+m026 XmzQ== X-Gm-Message-State: AHYfb5hWTweQ1X0ck3gz9u/eujFY98QvNli2x6Fi37ZZfaOTHKh1qZKS oalGIOpPKMzip/c5LD0= X-Received: by 10.99.117.67 with SMTP id f3mr10291238pgn.258.1503098617433; Fri, 18 Aug 2017 16:23:37 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id a17sm1454626pfl.167.2017.08.18.16.23.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Aug 2017 16:23:36 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Thomas Gleixner , Ingo Molnar , Miroslav Lichvar , Richard Cochran , Prarit Bhargava , Stephen Boyd , Shuah Khan , linux-kselftest@vger.kernel.org Subject: [RFC][PATCH] kselftests: timers: leap-a-day: Change default arguments to help test runs Date: Fri, 18 Aug 2017 16:23:32 -0700 Message-Id: <1503098612-26040-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <9fb88f04-f1ee-0c05-173e-db9bb4abb137@kernel.org> References: <9fb88f04-f1ee-0c05-173e-db9bb4abb137@kernel.org> Change default arguments for leap-a-day to always set the time each iteration (rather then waiting for midnight UTC), and to only run 10 interations (rather then infinite). If one wants to wait for midnight UTC, they can use the new -w flag, and we add a note to the argument help that -i -1 will run infinitely. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Stephen Boyd Cc: Shuah Khan Cc: linux-kselftest@vger.kernel.org Signed-off-by: John Stultz --- tools/testing/selftests/timers/leap-a-day.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/tools/testing/selftests/timers/leap-a-day.c b/tools/testing/selftests/timers/leap-a-day.c index fb46ad6..0670176 100644 --- a/tools/testing/selftests/timers/leap-a-day.c +++ b/tools/testing/selftests/timers/leap-a-day.c @@ -190,18 +190,18 @@ int main(int argc, char **argv) struct sigevent se; struct sigaction act; int signum = SIGRTMAX; - int settime = 0; + int settime = 1; int tai_time = 0; int insert = 1; - int iterations = -1; + int iterations = 10; int opt; /* Process arguments */ while ((opt = getopt(argc, argv, "sti:")) != -1) { switch (opt) { - case 's': - printf("Setting time to speed up testing\n"); - settime = 1; + case 'w': + printf("Only setting leap-flag, not changing time. It could take up to a day for leap to trigger.\n"); + settime = 0; break; case 'i': iterations = atoi(optarg); @@ -210,9 +210,10 @@ int main(int argc, char **argv) tai_time = 1; break; default: - printf("Usage: %s [-s] [-i ]\n", argv[0]); - printf(" -s: Set time to right before leap second each iteration\n"); - printf(" -i: Number of iterations\n"); + printf("Usage: %s [-w] [-i ]\n", argv[0]); + printf(" -w: Set flag and wait for leap second each iteration"); + printf(" (default sets time to right before leapsecond)\n"); + printf(" -i: Number of iterations (-1 = infinite, default is 10)\n"); printf(" -t: Print TAI time\n"); exit(-1); }