From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934322AbcIVRaf (ORCPT ); Thu, 22 Sep 2016 13:30:35 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:38861 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757030AbcIVRad (ORCPT ); Thu, 22 Sep 2016 13:30:33 -0400 Date: Thu, 22 Sep 2016 19:28:01 +0200 (CEST) From: Thomas Gleixner To: Binoy Jayan cc: Carsten Emde , "Steven Rostedt (Red Hat)" , Ingo Molnar , Daniel Wagner , Arnd Bergmann , Linux kernel mailing list , Masami , Mark Brown Subject: Re: [RFC PATCH v7 4/5] tracing: Measure delayed hrtimer offset latency In-Reply-To: Message-ID: References: <1474379517-7705-1-git-send-email-binoy.jayan@linaro.org> <1474379517-7705-5-git-send-email-binoy.jayan@linaro.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Binoy, On Thu, 22 Sep 2016, Binoy Jayan wrote: > The condition 'ktime_to_ns(tim) < ktime_to_ns(now)' checks if the timer > has already expired w.r.t. 'soft timeout' value as it does not include > the slack value 'delta_ns'. In that case 'tim_expiry' is normalized to > the current time. You are halfways coming close to the point why this is done, but your conclusion is completely wrong. The correct keyword is "expired", but anything else is just random speculation. > (I was under the impression that this inaccuracy > could be because timer was initially running on a different cpu. If that > is not the case, I guess we can use the code mentioned below). We are not playing a guessing game here. > I am using 'hrtimer_get_softexpires_tv64' instead of 'hrtimer_get_expires' > so that 'latency' is never negative. Please let me know if this looks ok. No it does not. And it won't look correct until you finally sit down and decode and understand the functionality behind this code. I'm not going to continue this, as it's not my job to explain you the code which you are trying to submit. I'm not blaming you, but I blame the responsible persons inside your company who task you with that and expect that I'm going to do their work of explaining to you how that code works. @Arnd, @Mark: I'm starting to get seriously grumpy about that. Thanks, tglx