From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758922AbcILNuO (ORCPT ); Mon, 12 Sep 2016 09:50:14 -0400 Received: from smtprelay0042.hostedemail.com ([216.40.44.42]:49568 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757879AbcILNuN (ORCPT ); Mon, 12 Sep 2016 09:50:13 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::,RULES_HIT:41:355:379:541:599:800:960:981:982:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1801:1981:2194:2198:2199:2200:2393:2553:2559:2562:2693:2895:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4559:4605:5007:6261:7875:7903:10004:10400:10450:10455:10848:10967:11026:11232:11658:11914:12043:12294:12438:12740:12760:13069:13161:13180:13229:13311:13357:13439:14096:14097:14181:14659:14721:19904:19999:21080:21433:30054:30070:30090:30091,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,LFtime:1,LUA_SUMMARY:none X-HE-Tag: limit88_1eb0c0a89f655 X-Filterd-Recvd-Size: 2759 Date: Mon, 12 Sep 2016 09:50:09 -0400 From: Steven Rostedt To: Thomas Gleixner Cc: Binoy Jayan , Ingo Molnar , Daniel Wagner , Arnd Bergmann , linux-kernel@vger.kernel.org, Masami Subject: Re: [PATCH v6 3/4] tracing: Add trace_irqsoff tracepoints Message-ID: <20160912095009.5c34a95d@gandalf.local.home> In-Reply-To: References: <1473246835-30075-1-git-send-email-binoy.jayan@linaro.org> <1473246835-30075-4-git-send-email-binoy.jayan@linaro.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; 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 On Thu, 8 Sep 2016 10:06:13 +0200 (CEST) Thomas Gleixner wrote: > > + > > if (preempt_trace() || irq_trace()) > > start_critical_timing(CALLER_ADDR0, CALLER_ADDR1); > > } > > @@ -431,6 +451,9 @@ void stop_critical_timings(void) > > { > > if (preempt_trace() || irq_trace()) > > stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1); > > + > > + if (unlikely(trace_latency_preempt_enabled())) > > + latency_preempt_timing_stop(LT_CRITTIME); > > And this is silly as well. You can put the whole evaluation into the trace > event assignement so the tracer core will handle that conditional. > > Aside of that it is silly to evaluate trace_clock_local() for the actual > tracepoint simply because that time is already stored in the tracepoint > itself. The flow here is: > > event = trace_event_buffer_lock_reserve(); > entry = ring_buffer_event_data(event); > { ; } <-- Here we assign the entries by the __field and > __array macros. > > > So you should talk to Steven about having a way to retrieve that time from > entry itself in a generic way. Note, the time stamp in the ring buffer is not guaranteed to be trace_local_clock(), it could be changed to be something like x86_64-tsc. That said, the timestamp that is saved in the event is an offset from the previous event (to save space in the buffer). It wont be efficient to calculate the timestamp at record time because of this. Although, the last stamp recoded is saved in the buffer descriptor. But it could be racy to capture it, as NMIs and interrupts could update it. -- Steve