Received: by 10.223.176.46 with SMTP id f43csp2295084wra; Thu, 25 Jan 2018 07:47:40 -0800 (PST) X-Google-Smtp-Source: AH8x226x0yARz3kSBEBbNw43U7O1IROuvEpNT6aCLID/wygwGUyUzTGVE/eKFIp2+Vn2907uo15u X-Received: by 10.98.248.75 with SMTP id c11mr16510304pfm.54.1516895260000; Thu, 25 Jan 2018 07:47:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516895259; cv=none; d=google.com; s=arc-20160816; b=iHZPJx1e3m6+e3ogeTrV+WUu1UknsstTwRQ+h8x5WtRbPzC3ei2LtiO69qeeF5qF7k p557jiFJXe/thGIVavZbwLsKnjBrfBwD7G46/iUxxovkyyl0lNbC4L1O6RNrZkTNsO4N APsqApBwohHHtlJ3f0GHErKtXnMh89PvBVvrJbicJN1dnRjQY6y65+F8f4b+LucKgJtl FsDgYeXfoGii3JkTqB1tzaZEWsJLsoT2RSN2SPglGh1db21ejZ3QbVERgaC8XAO8BMyd EkhlGGWX9XODjmx/CjEEzqh5kb6xOSDBNGU0chMKFbF0cXSdU//1nwkU3FheEpnm611f FaoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=FvGuaflBktfPQ06YueJj/tiV2f9MVQBhRjucfiabT94=; b=Nv68tkbfs8UrKA5WjTr+i0we17F2yaO5KGG/Ql0enutQRk4I1NJZYft/Q3dWG6yPRX krr8HjvzOsxR7WzwAnOWaEuV9z2nYDNYEj44jk1tuL2tPx0gOit1u5/OtqStiq8e4qkp Z5VZDjb3QIPDKpEBQrNmS2uzEuzscr2OHp2klHXAMzLFFP8o84NoqFuqghQoAdUkVjbi /RKplZHwnOjkIrvLZ6PKdqir9DgseYCJL5dKeReZjFWuw/czr4LOvhF47H7Zb6TTuQgO S4KEhF3V6jWW6DX9eiZaAams/gmTEtj0olwMCwmZVPyTSBsmPyRZ3BJf3EHpaCwgqvL8 WFDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=cHSHCpai; dkim=pass header.i=@codeaurora.org header.s=default header.b=bn51KLm5; 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 p2-v6si2148533plo.798.2018.01.25.07.47.25; Thu, 25 Jan 2018 07:47:39 -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; dkim=pass header.i=@codeaurora.org header.s=default header.b=cHSHCpai; dkim=pass header.i=@codeaurora.org header.s=default header.b=bn51KLm5; 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 S1751338AbeAYPpo (ORCPT + 99 others); Thu, 25 Jan 2018 10:45:44 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:38930 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751065AbeAYPpm (ORCPT ); Thu, 25 Jan 2018 10:45:42 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C912960A4E; Thu, 25 Jan 2018 15:45:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516895141; bh=j9tVkU6X679adBkQUWSf+ycJWG0Oz5rw2EaRIQnBMoI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cHSHCpai1dv4Pq5/JdcRRilRjbIzI9Rdtd/39UWplabbT1NoejmC5sI5s/Qa5hlOB 1jODhejop8wDkNWhMCEkNmxsE7tFxofYASqVZlHLtPd71zVPCZcOgNEKZM883ZBt9X W9ebuYD/0wYEoUR21KMOMfSc81jqbc8ZegnTjc6s= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ilina@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 90FAE60590; Thu, 25 Jan 2018 15:45:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516895140; bh=j9tVkU6X679adBkQUWSf+ycJWG0Oz5rw2EaRIQnBMoI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bn51KLm5m5MlZ48J5HO/RYaVwZYhefyGj9YfcsaCfa8m2XWf5bBxVjHzJSF+zXyBM OUdBfPcaltWnH8Bz31E1EtDdhCFkf62WTkIagm33vJBu0/kIIGOcA12YOA5r4Lywxr 4O4Fn+YRyqlCyp3Nnr8zvMBD3rxnC+rDc4ul/qeM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 90FAE60590 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=ilina@codeaurora.org Date: Thu, 25 Jan 2018 15:45:39 +0000 From: Lina Iyer To: Steven Rostedt 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: <20180125154539.GB24587@codeaurora.org> References: <20180123175656.11942-1-ilina@codeaurora.org> <20180123175656.11942-4-ilina@codeaurora.org> <20180123131326.0f4121e7@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180123131326.0f4121e7@gandalf.local.home> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 23 2018 at 18:13 +0000, Steven Rostedt wrote: >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. > Thanks Steve. I will take care of it in the next spin. -- Lina >-- Steve > > >> + __entry->func, __entry->pin, __entry->hwirq, __entry->type, >> + __entry->enable) >> +); >> + >> +#endif >> +#define TRACE_INCLUDE_FILE pdc >> +#include >