Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758136AbaGQXC2 (ORCPT ); Thu, 17 Jul 2014 19:02:28 -0400 Received: from mail-vc0-f179.google.com ([209.85.220.179]:60737 "EHLO mail-vc0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753896AbaGQXC1 (ORCPT ); Thu, 17 Jul 2014 19:02:27 -0400 MIME-Version: 1.0 In-Reply-To: References: <20140630144017.2abc48ba@gandalf.local.home> Date: Thu, 17 Jul 2014 16:02:26 -0700 Message-ID: Subject: Re: [PATCH-v2] tracing: Fix wraparound problems in "uptime" tracer From: Tony Luck To: Steven Rostedt Cc: Linux Kernel Mailing List , Ingo Molnar , "Luck, Tony" , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , " Xie XiuQi" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: 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] -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/