From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932817AbcIBP6g (ORCPT ); Fri, 2 Sep 2016 11:58:36 -0400 Received: from mail-qt0-f182.google.com ([209.85.216.182]:33871 "EHLO mail-qt0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932654AbcIBPyf (ORCPT ); Fri, 2 Sep 2016 11:54:35 -0400 MIME-Version: 1.0 In-Reply-To: References: <1472552924-22297-1-git-send-email-binoy.jayan@linaro.org> <1472552924-22297-4-git-send-email-binoy.jayan@linaro.org> From: Masami Hiramatsu Date: Sat, 3 Sep 2016 00:54:13 +0900 Message-ID: Subject: Re: [PATCH v4 3/3] tracing: Histogram for missed timer offsets To: Binoy Jayan Cc: "Steven Rostedt (Red Hat)" , Ingo Molnar , Daniel Wagner , Arnd Bergmann , Linux kernel mailing list Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2016-09-02 21:41 GMT+09:00 Binoy Jayan : > On 30 August 2016 at 16:20, Masami Hiramatsu > wrote: >> Hi Binoy, >>> >>> +static inline void trace_latency_hrtimer_mark_ts(struct hrtimer *timer, >>> + struct hrtimer_clock_base *new_base, >>> + ktime_t tim) >>> +{ >>> +#if defined(CONFIG_PREEMPT_TRACER) || defined(CONFIG_IRQSOFF_TRACER) >>> + if (trace_latency_hrtimer_interrupt_enabled()) { >> >> You would better use unlikely() here. >> >>> + ktime_t now = new_base->get_time(); >>> + >>> + if (ktime_to_ns(tim) < ktime_to_ns(now)) >> >> Wouldn't we need to consider the case of wrap around? >> >>> + timer->praecox = now; >>> + else >>> + timer->praecox = ktime_set(0, 0); >>> + } >>> +#endif >>> +} > > Hi Masami, > > I always see these values to be relative and not absolute time. I > found 'praecox' to be always zero during test. > What do you think. Ah, right. Since "tim" is expire time (timer target), that should always be "now + x" (x is enough larger than how long setting the hrtimer takes). Or, hrtimer expires before finished to set. :) Thank you, -- Masami Hiramatsu