From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v3 1/3] perf: Use monotonic clock as a source for timestamps Date: Tue, 4 Nov 2014 08:23:08 +0100 Message-ID: <20141104072308.GE10501@worktop.programming.kicks-ass.net> References: <1415060918-19954-1-git-send-email-pawel.moll@arm.com> <1415060918-19954-2-git-send-email-pawel.moll@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1415060918-19954-2-git-send-email-pawel.moll-5wv7dgnIgG8@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Pawel Moll Cc: Richard Cochran , Steven Rostedt , Ingo Molnar , Paul Mackerras , Arnaldo Carvalho de Melo , John Stultz , Masami Hiramatsu , Christopher Covington , Namhyung Kim , David Ahern , Thomas Gleixner , Tomeu Vizoso , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-api@vger.kernel.org On Tue, Nov 04, 2014 at 12:28:36AM +0000, Pawel Moll wrote: > +int sysctl_perf_sample_time_clk_id = CLOCK_MONOTONIC; const ? > /* > * perf samples are done in some very critical code paths (NMIs). > * If they take too much CPU time, the system can lock up and not > @@ -324,7 +326,7 @@ extern __weak const char *perf_pmu_name(void) > > static inline u64 perf_clock(void) > { > - return local_clock(); > + return ktime_get_mono_fast_ns(); > } Do we maybe want to make it boot-time switchable back to local_clock for people with bad systems and or backwards compat issues? Everybody using Core2 and older will very much not want to have this unless they've got a very good reason for wanting it.