From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755189AbaGRCJD (ORCPT ); Thu, 17 Jul 2014 22:09:03 -0400 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.230]:21132 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751401AbaGRCJB (ORCPT ); Thu, 17 Jul 2014 22:09:01 -0400 Date: Thu, 17 Jul 2014 22:08:49 -0400 From: Steven Rostedt To: Tony Luck Cc: Linux Kernel Mailing List , Ingo Molnar , "Luck, Tony" , =?ISO-8859-1?B?RnLpZOlyaWM=?= Weisbecker , " Xie XiuQi" Subject: Re: [PATCH-v2] tracing: Fix wraparound problems in "uptime" tracer Message-ID: <20140717220849.735bec65@gandalf.local.home> In-Reply-To: References: <20140630144017.2abc48ba@gandalf.local.home> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.24; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.118:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 17 Jul 2014 16:02:26 -0700 Tony Luck wrote: > On Mon, Jun 30, 2014 at 1:31 PM, Tony Luck wrote: > > +#else > > + jiffy *= HZ_TO_NSEC_NUM; > > + do_div(jiffy, HZ_TO_NSEC_DEN); > > + return jiffy; > > +#endif > > Well that didn't work either. kernel/trace/trace_clock.c doesn't include > timeconst.h - so we fail the compile because HZ_TO_NSEC_{NUM,DEN} > aren't defined. a #include looks dicey because timeconst.h is a generated > file up the the kernel/ level ... so getting Makefile dependencies right would > be ugly. > > Do we really need to convert to nanoseconds? Couldn't we just return > jiffies: Sure, and we can make it a "counter". That is, the counters don't hide 1000 counts on output. > > u64 notrace trace_clock_jiffies(void) > { > return jiffies_64 - INITIAL_JIFFIES; > } > > and leave it as an exercise to userspace to interpret that? > > -Tony > > [Yes, this changes the UI . but there can't be any serious users > given that the existing UI only works for 1hr 11 minutes after each > boot] I doubt it will break any tools, so it's fine. -- Steve