From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753917AbcH3OIw (ORCPT ); Tue, 30 Aug 2016 10:08:52 -0400 Received: from smtprelay0090.hostedemail.com ([216.40.44.90]:40740 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753564AbcH3OIm (ORCPT ); Tue, 30 Aug 2016 10:08:42 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::,RULES_HIT:41:355:379:541:599:800:960:967:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2525:2553:2560:2563:2682:2685:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:5007:6261:7875:7903:9025:10004:10400:10848:10967:11026:11232:11473:11657:11658:11914:12043:12291:12296:12438:12555:12683:12740:13161:13229:13439:14096:14097:14181:14659:14721:21080:21324:21365:21433:21451:30034:30054:30056: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:3,LUA_SUMMARY:none X-HE-Tag: drug09_116d42f0a8e4b X-Filterd-Recvd-Size: 3706 Date: Tue, 30 Aug 2016 10:08:38 -0400 From: Steven Rostedt To: Binoy Jayan Cc: Ingo Molnar , Daniel Wagner , Arnd Bergmann , linux-kernel@vger.kernel.org, Masami Subject: Re: [PATCH v4 2/3] tracing: Add trace_irqsoff tracepoints Message-ID: <20160830100838.05d4b87e@gandalf.local.home> In-Reply-To: <1472552924-22297-3-git-send-email-binoy.jayan@linaro.org> References: <1472552924-22297-1-git-send-email-binoy.jayan@linaro.org> <1472552924-22297-3-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 Tue, 30 Aug 2016 15:58:43 +0530 Binoy Jayan wrote: > This work is based on work by Daniel Wagner. A few tracepoints are added > at the end of the critical section. With the hist trigger in place, the > hist trigger plots may be generated, with per-cpu breakdown of events > captured. It is based on linux kernel's event infrastructure. > > The following filter(s) may be used > > 'hist:key=latency.log2:val=hitcount:sort=latency' > 'hist:key=ltype,latency:val=hitcount:sort=latency if cpu==1' > 'hist:key=ltype:val=latency:sort=ltype if ltype==0 && cpu==2' > > Where ltype is > 0: IRQSOFF latency > 1: PREEMPTOFF Latency > 2: Critical Timings > > This captures only the latencies introduced by disabled irqs and > preemption. Additional per process data has to be captured to calculate > the effective latencies introduced for individual processes. > > Initial work - latency.patch > > [1] https://git.kernel.org/cgit/linux/kernel/git/rt/linux-stable-rt.git/commit/?h=v3.14-rt-rebase&id=56d50cc34943bbba12b8c5942ee1ae3b29f73acb > > Signed-off-by: Binoy Jayan > --- > include/trace/events/latency.h | 35 +++++++++++++++++++++++++++++++++++ > kernel/trace/trace_irqsoff.c | 42 ++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 77 insertions(+) > create mode 100644 include/trace/events/latency.h > > diff --git a/include/trace/events/latency.h b/include/trace/events/latency.h > new file mode 100644 > index 0000000..e89be12 > --- /dev/null > +++ b/include/trace/events/latency.h > @@ -0,0 +1,35 @@ > +#undef TRACE_SYSTEM > +#define TRACE_SYSTEM latency > + > +#if !defined(_TRACE_HIST_H) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_HIST_H > + > +#include > + > +DECLARE_EVENT_CLASS(latency_template, > + TP_PROTO(int ltype, cycles_t latency), > + > + TP_ARGS(ltype, latency), > + > + TP_STRUCT__entry( > + __field(int, ltype) > + __field(cycles_t, latency) > + ), > + > + TP_fast_assign( > + __entry->ltype = ltype; > + __entry->latency = latency; > + ), > + > + TP_printk("ltype=%d, latency=%lu", > + __entry->ltype, (unsigned long) __entry->latency) The print of ltype should be text and not a number. Well, you could have both text and a number, but a number is useless for those looking at traces. There's infrastructure to do this, see __print_symbolic() and TRACE_DEFINE_ENUM(). -- Steve > +); > + > +DEFINE_EVENT(latency_template, latency_preempt, > + TP_PROTO(int ltype, cycles_t latency), > + TP_ARGS(ltype, latency)); > + > +#endif /* _TRACE_HIST_H */ > +