Received: by 10.223.176.5 with SMTP id f5csp940550wra; Fri, 2 Feb 2018 08:34:11 -0800 (PST) X-Google-Smtp-Source: AH8x226vSzzXylelLs4iJukrF6QqYlOPPRS0CgSPfzNOdXISj3gp/Wlp/w+vE+zC3+yzS5xACdOR X-Received: by 10.99.112.70 with SMTP id a6mr31391727pgn.152.1517589250843; Fri, 02 Feb 2018 08:34:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517589250; cv=none; d=google.com; s=arc-20160816; b=rC1fKF7ENvOcBoy/4hJHwwVfGcgwuYUopd9BqfaTi/kfZedeX+kUWFYdLrt95cXh5s 3NKUY5liQvtptHOLzZg4426/ZeimzXpwApNqIaJOl33f5xg/I31a9931nzyvI9vATyL7 eMkxHn3XyANL5BDqha8S7m2V9GwXBum2S7nEFBHkPj+mP+klF+Ichu8JqfDPkN7nI9Ox EeEXVa0kKBupMSt57dHQj5rZpvnCtmZFQ5y49U6Dme7uwQbu5GX4t+EaprGIIWg50UHa WGRQfKdSCanO2JUvbNVUZAveUp5Pz1ds9L+6a+OxEJKO/lQ4eRR1dg3uMXGVVKPvK88G qYWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=agFj6GgvBgGYeDDK1+JaX3g+OgSZDPbGtSbD0AiH4Lo=; b=Zp+YGS3w5VnoTRvz6wl+FktOQE+dFV4813VTVcSBLbrFIooo3l0OIddePt77/4O3U0 9D5mqqWgXhUi9eU0n7pZS9eoKD5G8jBzM0AYq0gHMdUENIefYG8NvKLQy9cJzl6I6b/8 hn4qxRD3bkqdHmyBSyQkaCQ7xTCZC2nFHNM1VjXvy1p44tFIh8jiahoxGzO6OHLjPimW qXMO5QzoZ0Ke3KypvT/hhMdAI3llKxMB7ehnrBd+w8g5FKoqrJRkfoT0/bw6/b7FermV AzTSy+9PUF/9/cVz/2m7Gl4jwLWO7fpAuIC6qssRqaZ7VZnG/y/I39W2nA93eNXSQ4mN F4RA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a63si1695458pge.448.2018.02.02.08.33.55; Fri, 02 Feb 2018 08:34:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752461AbeBBQcf (ORCPT + 99 others); Fri, 2 Feb 2018 11:32:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:33034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752386AbeBBQcb (ORCPT ); Fri, 2 Feb 2018 11:32:31 -0500 Received: from gandalf.local.home (cpe-172-100-180-131.stny.res.rr.com [172.100.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5ED6421724; Fri, 2 Feb 2018 16:32:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5ED6421724 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=rostedt@goodmis.org Date: Fri, 2 Feb 2018 11:32:27 -0500 From: Steven Rostedt To: Lina Iyer Cc: tglx@linutronix.de, jason@lakedaemon.net, marc.zyngier@arm.com, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, sboyd@codeaurora.org, rnayak@codeaurora.org, asathyak@codeaurora.org Subject: Re: [PATCH RFC v2 3/3] drivers: irqchip: pdc: log PDC info in FTRACE Message-ID: <20180202113227.23716bc9@gandalf.local.home> In-Reply-To: <20180202142200.6229-4-ilina@codeaurora.org> References: <20180202142200.6229-1-ilina@codeaurora.org> <20180202142200.6229-4-ilina@codeaurora.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2 Feb 2018 07:22:00 -0700 Lina Iyer wrote: Hi Lina, This looks really good. I have one nit below. > From: Archana Sathyakumar > > Log key PDC pin configuration in FTRACE. > > Cc: Steven Rostedt > Signed-off-by: Archana Sathyakumar > Signed-off-by: Lina Iyer > --- > drivers/irqchip/qcom-pdc.c | 7 ++++++ > include/trace/events/pdc.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 62 insertions(+) > create mode 100644 include/trace/events/pdc.h > > diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c > index a392380eada6..7f177ad88713 100644 > --- a/drivers/irqchip/qcom-pdc.c > +++ b/drivers/irqchip/qcom-pdc.c > @@ -26,6 +26,8 @@ > #include > #include > #include > +#define CREATE_TRACE_POINTS > +#include "trace/events/pdc.h" > > #define PDC_MAX_IRQS 126 > > @@ -68,6 +70,8 @@ static inline void pdc_enable_intr(struct irq_data *d, bool on) > enable = on ? ENABLE_INTR(enable, mask) : CLEAR_INTR(enable, mask); > pdc_reg_write(IRQ_ENABLE_BANK, index, enable); > spin_unlock_irqrestore(&pdc_lock, flags); > + > + trace_irq_pin_config(PDC_ENTRY, pin_out, (u64)d->chip_data, 0, on); > } > > static void qcom_pdc_gic_mask(struct irq_data *d) > @@ -149,6 +153,9 @@ static int qcom_pdc_gic_set_type(struct irq_data *d, unsigned int type) > > pdc_reg_write(IRQ_i_CFG, pin_out, pdc_type); > > + trace_irq_pin_config(PDC_TYPE_CONFIG, pin_out, (u64)d->chip_data, > + pdc_type, 0); I wonder if it makes more sense to just pass 'd' into the trace events, and then do the dereference there. The reason is to try to get as much code out of the calling path as possible. Even though trace events use jump labels and have no conditional branches, the code to call the function is still within the code using the trace events. By passing in 'd' and doing the redirect in the trace event code, we remove the setting up of the redirect from the caller, and save some cache lines in the process. -- Steve > + > return irq_chip_set_type_parent(d, type); > } > > diff --git a/include/trace/events/pdc.h b/include/trace/events/pdc.h > new file mode 100644 > index 000000000000..0e894bbc9e85 > --- /dev/null > +++ b/include/trace/events/pdc.h > @@ -0,0 +1,55 @@ > +/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 and > + * only version 2 as published by the Free Software Foundation. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + */ > + > +#undef TRACE_SYSTEM > +#define TRACE_SYSTEM pdc > + > +#if !defined(_TRACE_PDC_) || defined(TRACE_HEADER_MULTI_READ) > +#define _TRACE_PDC_H_ > + > +#include > + > +#define PDC_ENTRY 1 > +#define PDC_TYPE_CONFIG 2 > + > +TRACE_EVENT(irq_pin_config, > + > + TP_PROTO(u32 func, int pin, u64 hwirq, u32 type, u32 enable), > + > + TP_ARGS(func, pin, hwirq, type, enable), > + > + TP_STRUCT__entry( > + __field(u32, func) > + __field(int, pin) > + __field(u64, hwirq) > + __field(u32, type) > + __field(u32, enable) > + ), > + > + TP_fast_assign( > + __entry->func = func; > + __entry->pin = pin; > + __entry->hwirq = hwirq; > + __entry->type = type; > + __entry->enable = enable; > + ), > + > + TP_printk("%s hwirq:%lu pin:%d type:%u enable:%u", > + print_symbolic(__entry->func, > + { PDC_ENTRY, "pdc_entry" }, > + { PDC_TYPE_CONFIG, "pdc_type_config" }), > + __entry->pin, __entry->hwirq, __entry->type, __entry->enable) > +); > + > +#endif > +#define TRACE_INCLUDE_FILE pdc > +#include