Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752828AbbEHOl0 (ORCPT ); Fri, 8 May 2015 10:41:26 -0400 Received: from smtprelay0152.hostedemail.com ([216.40.44.152]:57886 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752053AbbEHOlX (ORCPT ); Fri, 8 May 2015 10:41:23 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2194:2198:2199:2200:2393:2553:2559:2562:2693:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4321:5007:6119:6261:7875:8526:9010:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12438:12517:12519:12555:12663:12740:14096:14097:21063:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: berry33_bd5d57be1a08 X-Filterd-Recvd-Size: 3520 Date: Fri, 8 May 2015 10:41:20 -0400 From: Steven Rostedt To: Drew Richardson Cc: Peter Zijlstra , Mathieu Desnoyers , Ingo Molnar , "linux-kernel@vger.kernel.org" , Thomas Gleixner , John Stultz , Wade Cherry , Pawel Moll Subject: Re: [PATCHv3] ftrace: Provide trace clock monotonic raw Message-ID: <20150508104120.3de866e0@gandalf.local.home> In-Reply-To: <20150508143037.GB1276@dreric01-Precision-T1650> References: <1430750469-16428-1-git-send-email-drew.richardson@arm.com> <199091314.42407.1430752205090.JavaMail.zimbra@efficios.com> <20150504200515.GA24626@dreric01-Precision-T1650> <20150504205748.GB21418@twins.programming.kicks-ass.net> <20150505145438.GA5145@dreric01-Precision-T1650> <20150508100903.39641009@gandalf.local.home> <20150508143037.GB1276@dreric01-Precision-T1650> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2273 Lines: 57 On Fri, 8 May 2015 07:30:39 -0700 Drew Richardson wrote: > Expose the NMI safe accessor to the monotonic raw clock to the > tracer. The mono clock was added with commit > 1b3e5c0936046e7e023149ddc8946d21c2ea20eb. The advantage of the > monotonic raw clock is that it will advance more constantly than the > monotonic clock. > > Imagine someone is trying to optimize a particular program to reduce > instructions executed for a given workload while minimizing the effect > on runtime. Also suppose that NTP is running and potentially making > larger adjustments to the monotonic clock. If NTP is adjusting the > monotonic clock to advance more rapidly, the program will appear to > use fewer instructions per second but run longer than if the monotonic > raw clock had been used. The total number of instructions observed > would be the same regardless of the clock source used, but how it's > attributed to time would be affected. > > Conversely if NTP is adjusting the monotonic clock to advance more > slowly, the program will appear to use more instructions per second > but run more quickly. Of course there are many sources that can cause > jitter in performance measurements on modern processors, but let's > remove NTP from the list. > > The monotonic raw clock can also be useful for tracing early boot, > e.g. when debugging issues with NTP. > Peter, Thomas, John, you OK with this? -- Steve > Signed-off-by: Drew Richardson > Acked-by: Mathieu Desnoyers > --- > kernel/trace/trace.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > index 05330494a0df..458031c31a37 100644 > --- a/kernel/trace/trace.c > +++ b/kernel/trace/trace.c > @@ -876,6 +876,7 @@ static struct { > { trace_clock_jiffies, "uptime", 0 }, > { trace_clock, "perf", 1 }, > { ktime_get_mono_fast_ns, "mono", 1 }, > + { ktime_get_raw_fast_ns, "mono_raw", 1 }, > ARCH_TRACE_CLOCKS > }; > -- 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/