From patchwork Wed Jun 21 05:21: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: 106043 Delivered-To: patches@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1753666qgd; Tue, 20 Jun 2017 22:21:48 -0700 (PDT) X-Received: by 10.98.30.65 with SMTP id e62mr10768066pfe.127.1498022508300; Tue, 20 Jun 2017 22:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498022508; cv=none; d=google.com; s=arc-20160816; b=SbjDBmsAw7bCJLDUJI04Z6chekLxVnPZlKVyziHH0X+FofMhnoJfZhIYGRnT+lRfBO 50JUDWhCqisbP3D7yVN6hrkMFQa4dCtEfohZdZrq1yE8xYUC0sZ4aruB+PlHatZ8uj68 TxEcEx9qyQNdIbeUNjLCDMZ1Vlvv/UJrkUKMigUiUJW7zwVt5FzgX2azngvj5Q45dXiv xq7s0dBfg3Xbtf3UE17M+X03JN+LfkTmQJV4IXUYwNqQhSdb7aQF2M7srjQZqg7C9R1v Y3sYqbMBDMdpuMU/jkT51yFMd81LNBZoXsyMl6Fgf8xAm/WOgufWSl89O38PeZImIfK0 ELBg== 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=FQMa1GYi7kdJd6yTnOwK7/OxS4BkWZVAL4XrKk70qHU=; b=ZtPQrA3wEICps5kFh/MmPSz++AOCLaZVHUSZwTF1j7tUjZlD9cHKk72zaL2aMFTQuv dvpQcRNR19sYgSp8EJrUQJxXoeUb6svS7ZTCPCZ5ByNzLiKe5G/XjGAf5hysZz9leQAI BTAiJdvUaDTjMiLfgE6JEn0X3+RvuRSwLvh8XNcsYl+PVS51LA5wDsieJk14FvDWn8Qq XeDh6MQaAbQFmlnol3QKwGmpzLkZ3hDO2UFMuvB+ev3F7nc4BGSo/ds43yjFeTLHH/9R u/km23ehxkRlrho1n+oMNNdTmFK2WTWuiLoU0tAWZXkjBGeaf1djM6uokbQx7bhNtoVx qMfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=i0iBTshE; 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 x125si11935261pfb.457.2017.06.20.22.21.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 22:21:48 -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.b=i0iBTshE; 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 132so38955761pgb.2 for ; Tue, 20 Jun 2017 22:21:48 -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=FQMa1GYi7kdJd6yTnOwK7/OxS4BkWZVAL4XrKk70qHU=; b=i0iBTshEEcftudzaSWKzoT+jb+waXDqSsSD2jBA2u8ug+v31kiQPOnais4k/u7k9kH qp0hxVXdrO3CKxCg1qNpcasi8hA+hvmhUGM4m0qLHkvOBMn7I1jq8LHHBYY4CapfFVRd oTWAmCeuglwDHjgI+zMyopj/0q4pmHoTQZJEM= 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=FQMa1GYi7kdJd6yTnOwK7/OxS4BkWZVAL4XrKk70qHU=; b=rCO2feY1XNydkNaMCPhvfokxQ66l2rFDQs5HUGhfXaDOC01b+OmFWn9YlI3Tiz868h NhmrG0Intdvv6ziefoOoBh3sJ2qocmjTvl1zUxDC1sSPhfIEGOea0dudFHctGI48jkeS nhPLpNALG2zVV0dEWWYVIHFGqUWoj1e4YmIJ6abYT8DFSlOFZNEGSV0Uh58MiqJ5ibQP YmBWmR6Ao8uQE/fU4dKnLY5bhfh1kHC53hNezxj/2gAKFcLPVHseTK0s4OSsPR9l4x2E kBSdd+Fc3St4HJcKD+1uWb6eu3cDSEgIJVzhqfXfDZTzOD/39LsOSD8iu1cN1MPHL6cg PFZA== X-Gm-Message-State: AKS2vOxQMXPb8qcG9plTJdt2Sle8y6I+a+1beKDC0cU19hp8LVJjcuco 6l07CJN1pbsDxMmqXYY= X-Received: by 10.84.248.79 with SMTP id e15mr29757896pln.118.1498022507909; Tue, 20 Jun 2017 22:21:47 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:1002:83f0:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id a69sm30405992pfg.91.2017.06.20.22.21.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 22:21:46 -0700 (PDT) From: John Stultz To: lkml Cc: Miroslav Lichvar , Thomas Gleixner , Ingo Molnar , Richard Cochran , Prarit Bhargava , Stephen Boyd , Shuah Khan , John Stultz Subject: [PATCH 3/4] kselftests: timers: Fix inconsistency-check to not ignore first timestamp Date: Tue, 20 Jun 2017 22:21:32 -0700 Message-Id: <1498022493-20292-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498022493-20292-1-git-send-email-john.stultz@linaro.org> References: <1498022493-20292-1-git-send-email-john.stultz@linaro.org> From: Miroslav Lichvar When the first timestamp in the list of clock readings was later than the second timestamp and all other timestamps were in order, the inconsistency was not reported because the index of the out-of-order timestamp was equal to the default value. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Miroslav Lichvar Cc: Richard Cochran Cc: Prarit Bhargava Cc: Stephen Boyd Cc: Shuah Khan Signed-off-by: Miroslav Lichvar Signed-off-by: John Stultz --- tools/testing/selftests/timers/inconsistency-check.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/tools/testing/selftests/timers/inconsistency-check.c b/tools/testing/selftests/timers/inconsistency-check.c index caf1bc9..74c60e8 100644 --- a/tools/testing/selftests/timers/inconsistency-check.c +++ b/tools/testing/selftests/timers/inconsistency-check.c @@ -118,7 +118,7 @@ int consistency_test(int clock_type, unsigned long seconds) start_str = ctime(&t); while (seconds == -1 || now - then < seconds) { - inconsistent = 0; + inconsistent = -1; /* Fill list */ for (i = 0; i < CALLS_PER_LOOP; i++) @@ -130,7 +130,7 @@ int consistency_test(int clock_type, unsigned long seconds) inconsistent = i; /* display inconsistency */ - if (inconsistent) { + if (inconsistent >= 0) { unsigned long long delta; printf("\%s\n", start_str);