[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150123142702.GA23123@twins.programming.kicks-ass.net>
Date: Fri, 23 Jan 2015 15:27:02 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: John Stultz <john.stultz@...aro.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Dave Jones <davej@...emonkey.org.uk>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Richard Cochran <richardcochran@...il.com>,
Prarit Bhargava <prarit@...hat.com>,
Stephen Boyd <sboyd@...eaurora.org>,
Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH 05/12] time: Add debugging checks to warn if we see delays
On Thu, Jan 22, 2015 at 04:09:20PM -0800, John Stultz wrote:
> +#ifdef CONFIG_DEBUG_TIMEKEEPING
> +static void timekeeping_check_update(struct timekeeper *tk, cycle_t offset)
> +{
> +
> + cycle_t max_cycles = tk->tkr.clock->max_cycles;
> + const char *name = tk->tkr.clock->name;
> +
> + if (offset > max_cycles)
> + printk_deferred("ERROR: cycle offset (%lld) is larger then"
> + " allowed %s max_cycles (%lld)\n",
> + offset, name, max_cycles);
> + else if (offset > (max_cycles >> 1))
> + printk_deferred("WARNING: cycle offset (%lld) is past"
> + " the %s 50%% safety margin (%lld)\n",
> + offset, name, max_cycles>>1);
> +}
> +#else
> +#define timekeeping_check_update(x, y)
static inline void timekeeping_check_update(struct timekeeper *tk, cycle_t offset) { }
Would preserve argument type checks. The only argument for using a macro
here would be to avoid evaluating the arguments, but that's not an issue
in this case afaict.
> +#endif
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists