Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1514974imm; Tue, 3 Jul 2018 12:38:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdcFReMDWwJScncp85sQsHTDWzDViR+1PTYsFhiMbub3GAd9VXgrFbXoaUdPKGuJJmlubAh X-Received: by 2002:a62:2414:: with SMTP id r20-v6mr31033748pfj.108.1530646711506; Tue, 03 Jul 2018 12:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530646711; cv=none; d=google.com; s=arc-20160816; b=ZZJQ1gN4AnFEKjEa+gh2Mm/c9004u1XKLDanOWfpI3zJMEsRdeKdv7aIZpNwxU7Nko YZlgb11tCpvJPWSILCU9WnDPp8BKEpnYQ0eG5oRpI7lYod2uipCbUoAbnWs+qrj52Q2D 9KnclLHcjeUaDgxXNGryL7o+7rqyy+X+hrRTA+tKq+yt0Bs6egUpt+LkXxR4/CuGpM1Q RnrL1QZkqlU6LzQfCEMnJU60X460JrJzpm5jgGcBfVf4Yh6+SnYeb8es1l6AFQjprIUx wHgZNLDWbTMbAnp8doVsgTxmpTEGLETY+yjw7apDmXv2ujBBQuVIdTkkWmT46ICYcNcS VYtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=pGrxGNn7UAs9qvT/dbK1Fzjj6AmfYYcIWE9WhtcC8u4=; b=b26q34Z9u/3y4709c97HYOtZUPmvFyqES6Mb1VGpfkyDsLrMOnsd3n5uWio9Exsksl muP30kJ0fgyM4IOZ5Ka7n1Ft8mtoqjufynJkSrvAxeJNL7NQ6Xw4YaVmHmsZiQafRW3x YJ1+Av1OYlmzxu68C4uxy52kUivk6QOr5aeAqVcI3GG6mh6lfUN2q4KRZuE4nJbnmlRF JLncOb1EOck6dFpcWbkgfXS5dsjmZXaadN6Yq3WDzdKDxgP6mDzEYQRR5uKeXsbxsrRX E1Y6JOUY8e2mX3GkFm+EJ3v1mEjbdkXp/cfIMLGhAiJ5MT+F0BKziuu3LOLbuSaUKyow avfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Im2K1+9t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4-v6si1645355pgs.362.2018.07.03.12.38.15; Tue, 03 Jul 2018 12:38:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Im2K1+9t; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752724AbeGCTgd (ORCPT + 99 others); Tue, 3 Jul 2018 15:36:33 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35922 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752105AbeGCTgc (ORCPT ); Tue, 3 Jul 2018 15:36:32 -0400 Received: by mail-pf0-f193.google.com with SMTP id u16-v6so1486484pfh.3 for ; Tue, 03 Jul 2018 12:36:31 -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; bh=pGrxGNn7UAs9qvT/dbK1Fzjj6AmfYYcIWE9WhtcC8u4=; b=Im2K1+9tDfAoMQklXs+XckHWYeAfa9jVIkxDJlq9bL8DealfUTb3gmzLozotNunVrF ZRQUtlXpTnGcxr2EuwxVMJUdlIQEeC1yv302LzsPfoS4Bd8VFqONnLC+U0YOp+PVs2nX U7JaHwAve4AlXrCh4N97pwWsUEu82b5+SXl+A= 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; bh=pGrxGNn7UAs9qvT/dbK1Fzjj6AmfYYcIWE9WhtcC8u4=; b=JVPpl9lqHQV9Ja46VB/r4zaPcoFHALeKjbyuZFhCgt4zAGYbvJunx4bsJLMhDdJ62+ oMHohY/mu8kA83I1EjEmgzqGzqAgJR0I2T+I2hRpQvZbp7nJo9QTjFpO/2b6+EcuGyP7 ElWZnrqyqRaeWo+zKpOd2EXXRriJ+3iVyXqFUbsoUzGzzRAY8Y9xrBLvy8tOJqjT58uL Er7MXBkFfEffXEZNAjKNvbjUOp76Zsp1wkdQMvXgbCjGuIfkAO5cAv98xAO7xalf37r9 R4ecZv9jTM4QkkCAgna543B9r1m38loaf5WFfV0hXRzxfo4lCsJp58klPP8WKhBoNYTj SrkA== X-Gm-Message-State: APt69E2O0FxJ/JYSz0ZIvFhaQ2zzGlK+2qYsBJ1nYC1IoR+0scAOW0k8 rxK9VCedJBTHw07Im1+uyD3HoRJck9w= X-Received: by 2002:a63:ec14:: with SMTP id j20-v6mr8514017pgh.28.1530646591108; Tue, 03 Jul 2018 12:36:31 -0700 (PDT) Received: from localhost.localdomain ([2601:1c2:600:5100:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id e10-v6sm3132905pgv.48.2018.07.03.12.36.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Jul 2018 12:36:30 -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] selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET is in progress Date: Tue, 3 Jul 2018 12:36:27 -0700 Message-Id: <1530646587-12101-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the past we've warned when ADJ_OFFSET was in progress, usually caused by ntpd or some other time adjusting daemon running in non steady sate, which can cause the skew calculations to be incorrect Thus, this patch sets a flag which we check when we fail so that we don't cause false negatives. 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 Suggested-by: Miroslav Lichvar Signed-off-by: John Stultz --- tools/testing/selftests/timers/raw_skew.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/timers/raw_skew.c b/tools/testing/selftests/timers/raw_skew.c index ca6cd14..d3fc453 100644 --- a/tools/testing/selftests/timers/raw_skew.c +++ b/tools/testing/selftests/timers/raw_skew.c @@ -94,6 +94,7 @@ int main(int argv, char **argc) struct timespec mon, raw, start, end; long long delta1, delta2, interval, eppm, ppm; struct timex tx1, tx2; + int adj_offset_bad = 0; setbuf(stdout, NULL); @@ -108,8 +109,10 @@ int main(int argv, char **argc) start = mon; delta1 = diff_timespec(mon, raw); - if (tx1.offset) + if (tx1.offset) { printf("WARNING: ADJ_OFFSET in progress, this will cause inaccurate results\n"); + adj_offset_bad = 1; + } printf("Estimating clock drift: "); sleep(120); @@ -134,6 +137,10 @@ int main(int argv, char **argc) printf(" %lld.%i(act)", ppm/1000, abs((int)(ppm%1000))); if (llabs(eppm - ppm) > 1000) { + if (adj_offset_bad) { + printf(" [SKIP]\n"); + return ksft_exit_skip("ADJ_OFFSET in progress. Shutdown NTPd or other time steering daemons\n"); + } printf(" [FAILED]\n"); return ksft_exit_fail(); } -- 2.7.4