From patchwork Mon Aug 17 20:40:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 52477 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id EB55D2156D for ; Mon, 17 Aug 2015 20:41:13 +0000 (UTC) Received: by labd1 with SMTP id d1sf50752625lab.0 for ; Mon, 17 Aug 2015 13:41:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=prWBkeibxxwyODIGLuHOR+GHmXNTJ19VLf7euk4Iuok=; b=NKiEAuUaGhVseBz8EOsORV9w+vgO3CtcQLhIaNoNYKiEB9CNr+0bcH9B7Cor87Xpab ivvRc3BdDpxHiyuPlDJdGyWdtt4XBd5i+W9lNkbeLMP0CRBhETo8Gfh+hCwwb71lKbbb fl6PUvn1dwkURXMfhZbPUvzJ3ShdJ6G9Oq7d1rwYXYMEFIrSloLFqyjFjlOHnm+T3uE5 Snz+tnlJllpDprV7snuzUVb2TIWaubrKr7DTkuy3+nv2FzKSEhDrxdQRC5ieVWnnxeWQ b53hVEexuL4FPSSbACq1PMuJxERJTTKp4C/FroLkA4UCwA++s0uY8t92CA8lt57ZdC1S flcg== X-Gm-Message-State: ALoCoQnUJtXs4GyWhe0PPlbcln0PPBEuUkcD/1WhqpJ5xEMbqFNZ9r8bMvjhDZscOjb6qGzwOV7S X-Received: by 10.112.167.201 with SMTP id zq9mr820992lbb.2.1439844072938; Mon, 17 Aug 2015 13:41:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.139 with SMTP id o11ls724043lal.80.gmail; Mon, 17 Aug 2015 13:41:12 -0700 (PDT) X-Received: by 10.152.27.134 with SMTP id t6mr2630455lag.100.1439844072671; Mon, 17 Aug 2015 13:41:12 -0700 (PDT) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id h15si12360043lbg.139.2015.08.17.13.41.12 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Aug 2015 13:41:12 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by lbbpu9 with SMTP id pu9so90200353lbb.3 for ; Mon, 17 Aug 2015 13:41:12 -0700 (PDT) X-Received: by 10.152.44.196 with SMTP id g4mr2659985lam.56.1439844072460; Mon, 17 Aug 2015 13:41:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.162.200 with SMTP id yc8csp85849lbb; Mon, 17 Aug 2015 13:41:11 -0700 (PDT) X-Received: by 10.68.57.170 with SMTP id j10mr6177554pbq.56.1439844070518; Mon, 17 Aug 2015 13:41:10 -0700 (PDT) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com. [209.85.220.46]) by mx.google.com with ESMTPS id kk3si26333167pdb.118.2015.08.17.13.41.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Aug 2015 13:41:10 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.46 as permitted sender) client-ip=209.85.220.46; Received: by pabyb7 with SMTP id yb7so115755241pab.0 for ; Mon, 17 Aug 2015 13:41:09 -0700 (PDT) X-Received: by 10.68.135.161 with SMTP id pt1mr6023979pbb.47.1439844069576; Mon, 17 Aug 2015 13:41:09 -0700 (PDT) Received: from localhost.localdomain (c-76-115-103-22.hsd1.or.comcast.net. [76.115.103.22]) by smtp.gmail.com with ESMTPSA id gu2sm85199pbc.1.2015.08.17.13.41.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Aug 2015 13:41:08 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Prarit Bhargava , Daniel Bristot de Oliveira , Richard Cochran , Jan Kara , Jiri Bohac , Thomas Gleixner , Ingo Molnar , Shuah Khan Subject: [PATCH 1/9] timer_list: Add the base offset so remaining nsecs are accurate for non monotonic timers Date: Mon, 17 Aug 2015 13:40:55 -0700 Message-Id: <1439844063-7957-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439844063-7957-1-git-send-email-john.stultz@linaro.org> References: <1439844063-7957-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , I noticed for non-monotonic timers in timer_list, some of the output looked a little confusing. For example: #1: <0000000000000000>, posix_timer_fn, S:01, hrtimer_start_range_ns, leap-a-day/2360 # expires at 1434412800000000000-1434412800000000000 nsecs [in 1434410725062375469 to 1434410725062375469 nsecs] You'll note the relative time till the expiration "[in xxx to yyy nsecs]" is incorrect. This is because its printing the delta between CLOCK_MONOTONIC time to the CLOCK_REALTIME expiration. This patch fixes this issue by adding the clock offset to the "now" time which we use to calculate the delta. Cc: Prarit Bhargava Cc: Daniel Bristot de Oliveira Cc: Richard Cochran Cc: Jan Kara Cc: Jiri Bohac Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Shuah Khan Signed-off-by: John Stultz --- kernel/time/timer_list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c index a4536e1..129c960 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c @@ -137,7 +137,7 @@ print_base(struct seq_file *m, struct hrtimer_clock_base *base, u64 now) (unsigned long long) ktime_to_ns(base->offset)); #endif SEQ_printf(m, "active timers:\n"); - print_active_timers(m, base, now); + print_active_timers(m, base, now + ktime_to_ns(base->offset)); } static void print_cpu(struct seq_file *m, int cpu, u64 now)