From patchwork Tue Jul 3 19:36:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 140998 Delivered-To: patches@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1538339ljj; Tue, 3 Jul 2018 12:36:31 -0700 (PDT) X-Received: by 2002:a17:902:1005:: with SMTP id b5-v6mr31721291pla.207.1530646591676; Tue, 03 Jul 2018 12:36:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530646591; cv=none; d=google.com; s=arc-20160816; b=d/YXD3Y41zVmD4HWXYJI0x8KwWy8JpZKKR1Z7zpbSka7XXlA6kTK1oO9BPY9sKhiAp gBQjxaAGObS00P8U1LBX0QfC3zhKsPmWdoRim95sYOT6YcnGpTjCC/x0AVuTfI+wsPgN DyZaF8e95q0Ym6iL3dwp2WBfrMCbyyCE3zvZLfksxCX59G8X2oCCOOJYqbqVWI1z0koM 2UT95fUhQiiM4Ri0/coi7hGdAOOFm0vKqX05neaMQeIWrO/swdKTaLudorxPtUfkKAZl FQyVPWDm50ZoLkJm3DfWOFSBRYY6W7qBwUBhi45PrticBYGiGYvvvj6dMcfaAZQdYwR1 AUYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=pGrxGNn7UAs9qvT/dbK1Fzjj6AmfYYcIWE9WhtcC8u4=; b=r4nhQIhvLZO/UX65PznR9dnxkn20JS1J2FjHnSnMC/tcqoG1pXI4DmxLZSsSl+z43Z ezyfT+J4n6ijMQ6RSziUnKQAUTruiX8/8T8scJAFl1VoQfZQSU1tCGug8GyK/4mQ9S+m pNX+V0o9MrwlYQYcw+7R1Wdwc6VaGLcHrvMxczYWDIsh9KSVJ6liMW/ozE4C/T/AFJKC c/ptEO7J4gboVaKDqYYqojbO/mjNHYDTGHL2MuMRfmFdPUAN7UKzLV7jb00VXXN95F9v 8rbahdq4pPWvCDaXyiqed9LeuAjZF/lEs9LbiI44oBUUDsexe8w2rwwar4py+rT6d2+d rRdQ== 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: domain of john.stultz@linaro.org designates 209.85.220.65 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-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id u5-v6sor464701pgo.364.2018.07.03.12.36.31 for (Google Transport Security); Tue, 03 Jul 2018 12:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Im2K1+9t; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=DB1ytGGSeC/qBk8ZvB9CNBnxQOYAOQ4Kpkna0qSEVqb3C+VPVb+NzIfbiDt6j7zwn0 dtXaHKn/we3JHMLLG+bAaIYqhqL3hWThqVVeXK2Qs9oA8CCReg3fCViFaE2zioDfsiGc DjIrItaPzPcOd+L2mxmdZJ7zil/9+8HDEPQXJGoUbmxM0oedIRIqMGZFOpshsWx2PZv2 VHtOgNDIsqDWxcHmO2kqerKT4iMw2vAIJs40jBqrEm8NJjSW5mDCh4hI0Kz8CNMIlE6u O531lrbFkGRYfJlwUq0BHHIgh/pLFfC94Nc83oFG4s2K+4MW0we6AG3bZqWH/cdbVB1Y 0o4A== X-Gm-Message-State: APt69E3Zkwua4k9U9fD7jx8hM2dNQhXz8Bflf6ZDPWzZKKNKJvsZigPa mxN9XrtEUH7W05XOcKNPxox4Oqvx X-Google-Smtp-Source: AAOMgpd1uPsnKl5w9E3KnqgSwtPJKxQ4b9uPNlJKN32ZiTDu6PWOyoYWqyzU0DssKQcZhq3hdoVh3w== X-Received: by 2002:a63:ec14:: with SMTP id j20-v6mr8514017pgh.28.1530646591108; Tue, 03 Jul 2018 12:36:31 -0700 (PDT) Return-Path: 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 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(-) -- 2.7.4 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(); }