From patchwork Wed Jun 24 16:17:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ankit Gupta X-Patchwork-Id: 6669051 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: X-Original-To: patchwork-linux-arm-msm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3417DC05AC for ; Wed, 24 Jun 2015 16:17:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 07BFA20429 for ; Wed, 24 Jun 2015 16:17:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07E10205B1 for ; Wed, 24 Jun 2015 16:17:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753523AbbFXQRm (ORCPT ); Wed, 24 Jun 2015 12:17:42 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:40749 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753507AbbFXQRl (ORCPT ); Wed, 24 Jun 2015 12:17:41 -0400 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 8AAC513FC1C; Wed, 24 Jun 2015 16:17:40 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 596B813FCAF; Wed, 24 Jun 2015 16:17:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from gavidov-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ankgupta@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 230FD13FCAC; Wed, 24 Jun 2015 16:17:38 +0000 (UTC) From: Ankit Gupta To: rostedt@goodmis.org, 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 Cc: gavidov@codeaurora.org, sdharia@codeaurora.org, linux-arm-msm@vger.kernel.org, mlocke@codeaurora.org, Ankit Gupta Subject: [PATCH V3] trace/events: add chip name and hwirq to irq entry tracepoint Date: Wed, 24 Jun 2015 10:17:30 -0600 Message-Id: <1435162650-32266-1-git-send-email-ankgupta@codeaurora.org> X-Mailer: git-send-email 2.4.3 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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) + /** * 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)) ); /**