Received: by 10.223.176.46 with SMTP id f43csp4503952wra; Tue, 23 Jan 2018 10:14:07 -0800 (PST) X-Google-Smtp-Source: AH8x227Y1pv/KaNnXy+o913MFnO6oX7x5v4O1x/Is3gjCPL2JNumEsLvYN05Sl/eQ+HiKPKZozjM X-Received: by 10.36.160.201 with SMTP id o192mr4697699ite.48.1516731247507; Tue, 23 Jan 2018 10:14:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516731247; cv=none; d=google.com; s=arc-20160816; b=lhYzvARAg9831o5Wx9OlWzsMLBUbqSh1kw/mZ+CnVKztM1Rna+z8Zwg6NwWewLR3/l d4V4Pxn9VN0BMKtkfyqs+vb3sX82JJ55jCW2eFNm2988vQZIqK4peUzgyPCQCRmXWP6X s+J0fyfQ8XSI2L/LMKtKEF5kEjXDjYdBy5NbktHU4D1YFmXkgBu3PXq3Au0sBUeC6sl1 cfltrR4GgD5RRzODAN5eiIVtLaWx9HjcPoTLjYi/7vLxRfXdryIlNmE5+0KuD3LMIvKy axRIoIlCIfF1Z2jm68wJKnrtcRsKC/s0wwCvKzJAII4F+5LhjnrD5At5l0NkXhelAKXQ 6FfQ== 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=edp3yJr2NigSkHQ9r+1gIto8r9FRzwvgbR+aMT1kAVc=; b=Hx4op7e++KDDSwlGlLolMUEzGwUpzp9L7e7gP9DBwXbtsDLlJAQfeoO7IHfTS5nj4V PT1yhaxCtPr7PEP1vGGJxHLCxgLyT5U5vZty4p27CAjRaXpZ2TPnotl3bYj7KDdmzbB4 6m8QEshDPXF9+MKkob/oYvycMt2S/Xr5t9T+AEs0P1BtlkEIiS/gnjlxU5qJeVBggC79 tsE4IzrklLCmppUDejp8ZCx/oVAyGs03G0LMutVocEwHVbZdvMMWzRfGyESAt9gYMBsL hvJz5Zbg/C6jzg06h6+viBVIh+EjCX0OqP01Ielao5A1ItlNKbRE8dMjXbdoqkzaviXb ZvBw== 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 j4si15473938ioe.7.2018.01.23.10.13.54; Tue, 23 Jan 2018 10:14:07 -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 S1752033AbeAWSNa (ORCPT + 99 others); Tue, 23 Jan 2018 13:13:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:38816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751796AbeAWSN3 (ORCPT ); Tue, 23 Jan 2018 13:13:29 -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 D722921785; Tue, 23 Jan 2018 18:13:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D722921785 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: Tue, 23 Jan 2018 13:13:26 -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 3/4] drivers: irqchip: pdc: log PDC info in FTRACE Message-ID: <20180123131326.0f4121e7@gandalf.local.home> In-Reply-To: <20180123175656.11942-4-ilina@codeaurora.org> References: <20180123175656.11942-1-ilina@codeaurora.org> <20180123175656.11942-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 Tue, 23 Jan 2018 10:56:55 -0700 Lina Iyer wrote: > From: Archana Sathyakumar Hi Lina and Archana, > > 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 | 6 ++++++ > include/trace/events/pdc.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 56 insertions(+) > create mode 100644 include/trace/events/pdc.h > > diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c > index 57f1348bd81c..9b626e9f3a29 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" > > #include "qcom-pdc.h" > > @@ -78,6 +80,7 @@ static inline void pdc_enable_intr(struct irq_data *d, bool on) > break; > udelay(5); > } while (1); > + trace_irq_pin_config("enable", (u32)pin_out, (u32)d->hwirq, 0, on); I'm concerned with that string you are passing in. > spin_unlock_irqrestore(&pdc_lock, flags); > WARN_ON(r_enable != enable); > } > @@ -161,6 +164,9 @@ static int qcom_pdc_gic_set_type(struct irq_data *d, unsigned int type) > udelay(5); > } while (1); > > + trace_irq_pin_config("type_config", (u32)pin_out, (u32)d->hwirq, This one too. > + pdc_type, 0); > + > /* > * If type is edge triggered, forward that as Rising edge as PDC > * takes care of converting falling edge to rising edge signal > diff --git a/include/trace/events/pdc.h b/include/trace/events/pdc.h > new file mode 100644 > index 000000000000..bec54c414880 > --- /dev/null > +++ b/include/trace/events/pdc.h > @@ -0,0 +1,50 @@ > +/* 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 > + > +TRACE_EVENT(irq_pin_config, > + > + TP_PROTO(char *func, u32 pin, u32 hwirq, u32 type, u32 enable), > + > + TP_ARGS(func, pin, hwirq, type, enable), > + > + TP_STRUCT__entry( > + __field(char *, func) > + __field(u32, pin) > + __field(u32, hwirq) > + __field(u32, type) > + __field(u32, enable) > + ), > + > + TP_fast_assign( > + __entry->pin = pin; > + __entry->func = func; > + __entry->hwirq = hwirq; > + __entry->type = type; > + __entry->enable = enable; > + ), > + > + TP_printk("%s hwirq:%u pin:%u type:%u enable:%u", %s is dereferencing a pointer, which works fine when reading the ASCII translated trace files (/sys/kernel/debug/tracing/trace and friends). But it breaks when we use trace-cmd or perf. Because they record the binary data and they do not have access to memory inside the kernel. What I would recommend is in pdc.h have: #define PDC_ENTRY 1 #define PDC_TYPE_CONFIG 2 Then have the tracepoints do instead of: trace_irq_pin_config("enable", ...); trace_irq_pin_config("type_config", ...); Have them do: trace_irq_pin_config(PDC_ENTRY, ...); trace_irq_pin_config(PDC_TYPE_CONFIG, ...); And then have: TP_PROTO(u32 func, ...) TP_STRUCT__entry( __field(u32, func) [...] TP_fast_assign( __entry->func = func; [...] TP_printk("%s hwirq...", print_symbolic(__entry->func, { PDC_ENTRY, "entry" }, { PDC_TYPE_CONFIG, "type_config" }), [...] And you will get the same effect, with trace-cmd and perf still working as expected. -- Steve > + __entry->func, __entry->pin, __entry->hwirq, __entry->type, > + __entry->enable) > +); > + > +#endif > +#define TRACE_INCLUDE_FILE pdc > +#include