On 09/11/2013 08:12 AM, Mathieu Desnoyers wrote: > LTTng uses ktime to have the same time-base across kernel and > user-space, so traces gathered from LTTng-modules and LTTng-UST can be > correlated. We plan on using ktime until a fast, scalable, and > fine-grained time-source for tracing that can be used across kernel and > user-space, and which does not rely on read seqlock for kernel-level > synchronization, makes its way into the kernel. > > Cc: Thomas Gleixner <t...@linutronix.de> > Cc: Richard Cochran <richardcoch...@gmail.com> > Cc: Prarit Bhargava <pra...@redhat.com> > Cc: John Stultz <john.stu...@linaro.org> > Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> > Cc: Peter Zijlstra <pet...@infradead.org> > Cc: Steven Rostedt <rost...@goodmis.org> > Cc: Ingo Molnar <mi...@elte.hu> > Signed-off-by: Mathieu Desnoyers <mathieu.desnoy...@efficios.com> > --- > diff --git a/wrapper/trace-clock.h b/wrapper/trace-clock.h > index bced61c..2f9df7a 100644 > --- a/wrapper/trace-clock.h > +++ b/wrapper/trace-clock.h > @@ -32,6 +32,7 @@ > #include <linux/ktime.h> > #include <linux/time.h> > #include <linux/hrtimer.h> > +#include <linux/version.h> > #include "random.h" > > static inline u64 trace_clock_monotonic_wrapper(void) > @@ -45,6 +46,10 @@ static inline u64 trace_clock_monotonic_wrapper(void) > if (in_nmi()) > return (u64) -EIO; > > +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) > + if (timekeeping_is_busy()) > + return (u64) -EIO; > +#endif > ktime = ktime_get(); > return ktime_to_ns(ktime); > }
I guess the other question here is should this functionality be pushed down into the timekeeping accessors themselves? I know any extra checks would probably be considered overhead in some uses, but if we do the check only when we hit contention then it might not be so bad. thanks -john _______________________________________________ lttng-dev mailing list lttng-dev@lists.lttng.org http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev