From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751274AbZHRS6j (ORCPT ); Tue, 18 Aug 2009 14:58:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751132AbZHRS6i (ORCPT ); Tue, 18 Aug 2009 14:58:38 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.125]:55564 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750900AbZHRS6i (ORCPT ); Tue, 18 Aug 2009 14:58:38 -0400 Date: Tue, 18 Aug 2009 14:58:38 -0400 (EDT) From: Steven Rostedt X-X-Sender: rostedt@gandalf.stny.rr.com To: KOSAKI Motohiro cc: Zhaolei , Frederic Weisbecker , Ingo Molnar , LKML Subject: Re: [RFC PATCH] Add timer-source of walltime for ftrace In-Reply-To: <20090818215620.A63C.A69D9226@jp.fujitsu.com> Message-ID: References: <4A89213C.5090109@cn.fujitsu.com> <20090818215620.A63C.A69D9226@jp.fujitsu.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 19 Aug 2009, KOSAKI Motohiro wrote: > > +u64 notrace trace_clock_walltime(void) > > +{ > > + u32 remainder; > > + return base_walltime.tv_sec + div_u64_rem( > > + trace_clock() + base_walltime.tv_nsec, > > + NSEC_PER_SEC, &remainder); > > +} > > Why do we need calculate walltime at ring-buffer recordng phase? > IOW, Why can't we calculate this at displaing time? Right! We should have something like this: return (u64)base_walltime.tv_sec * NSEC_PER_SEC + trace_clock() + base_walltime.tv_nsec; And then we could divide it out later. And then we could even show more fields in the output and not limit ourselves to seconds. -- Steve