From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753905AbbFXQmq (ORCPT ); Wed, 24 Jun 2015 12:42:46 -0400 Received: from smtprelay0080.hostedemail.com ([216.40.44.80]:46852 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753968AbbFXQmb (ORCPT ); Wed, 24 Jun 2015 12:42:31 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:2904:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3872:3873:3874:4321:5007:6261:6742:7875:7903:10004:10400:10848:10967:11026:11232:11658:11914:12043:12438:12517:12519:12555:12663:12740:13095:13161:13180:13229:14096:14097:21080:21088,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: feet77_15a428c87b049 X-Filterd-Recvd-Size: 3571 Date: Wed, 24 Jun 2015 12:42:27 -0400 From: Steven Rostedt To: Ankit Gupta Cc: mingo@redhat.com, agross@codeaurora.org, davem@davemloft.net, rdunlap@infradead.org, standby24x7@gmail.com, sboyd@codeaurora.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, gavidov@codeaurora.org, sdharia@codeaurora.org, linux-arm-msm@vger.kernel.org, mlocke@codeaurora.org Subject: Re: [PATCH V3] trace/events: add chip name and hwirq to irq entry tracepoint Message-ID: <20150624124227.1cddbbac@gandalf.local.home> In-Reply-To: <1435162650-32266-1-git-send-email-ankgupta@codeaurora.org> References: <1435162650-32266-1-git-send-email-ankgupta@codeaurora.org> 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 On Wed, 24 Jun 2015 10:17:30 -0600 Ankit Gupta wrote: > Add chip name and hw-irq number to the trace_irq_handler_entry() > tracepoint. When tracing interrupt events the chip-name and hw-irq > numbers are stable and known in advance. This makes them a better > choice as a filtering criteria for the trace buffer dump. On the > flipside, the os-irq numbers are dynamically allocated which makes > them difficult to use for the same purpose. > > Dump messages will look like: > ...irq_handler_entry: irq=22 name=msm_serial0 chip_name=GIC hwirq=140 > > Suggested-by: Stephen Boyd > Reviewed-by: Andy Gross > Signed-off-by: Gilad Avidov > Signed-off-by: Ankit Gupta > --- > Changes since V2: > - fixed dump message in commit text to reflect Chip name > instead of domain. > --- > Changes since V1: > - added reviewed by Andy Gross > --- > include/trace/events/irq.h | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h > index 3608beb..5370075 100644 > --- a/include/trace/events/irq.h > +++ b/include/trace/events/irq.h > @@ -23,6 +23,17 @@ struct softirq_action; > softirq_name(HRTIMER), \ > softirq_name(RCU)) > > + > +#define show_chip_name(irq) \ > + (irq_get_irq_data(irq) \ > + ? irq_get_irq_data(irq)->chip->name \ > + : "NULL") > + > +#define show_hwirq(irq) \ > + (irq_get_irq_data(irq) \ > + ? irq_get_irq_data(irq)->hwirq \ > + : -ENODEV) Note these magic functions will only be useful for the tracefs reads of the trace files. Userspace tools that extract the data (like perf and trace-cmd), will have no idea of how to parse it. I'm not against doing this, but I'm just letting you know what the effect of this change will be. -- Steve > + > /** > * irq_handler_entry - called immediately before the irq action handler > * @irq: irq number > @@ -50,7 +61,9 @@ TRACE_EVENT(irq_handler_entry, > __assign_str(name, action->name); > ), > > - TP_printk("irq=%d name=%s", __entry->irq, __get_str(name)) > + TP_printk("irq=%d name=%s chip_name=%s hwirq=%ld", __entry->irq, > + __get_str(name), show_chip_name(__entry->irq), > + show_hwirq(__entry->irq)) > ); > > /**