Received: by 10.223.185.111 with SMTP id b44csp863989wrg; Fri, 9 Mar 2018 15:30:04 -0800 (PST) X-Google-Smtp-Source: AG47ELtJ7ooIuHMJsGHOj+aPeQER0Ovi8yGb7SiVI8sb3i4VWB/b9kbSOfgmuibTymk9XH5wmmfM X-Received: by 2002:a17:902:d24:: with SMTP id 33-v6mr221891plu.8.1520638204162; Fri, 09 Mar 2018 15:30:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520638204; cv=none; d=google.com; s=arc-20160816; b=OA6Flq+cAire/2wEG+9SK56Cj2PIJOcB4YAK7EpSGyHaebjKXm7tnA5VN2x/QFa1hU 6cvNLZ+5FSMOs9PeH4XyK1tpw/Tt3Vs7Qe5v9XiZgscs5+aimCoMm6Xx/DcTi61jb7ux si9FghLCYc22bPhcEJTMT5OxhBPQ0cAClx+z+sV9JzQOn+INaSyERLGXDTdKtt3lqZUF zQnbiV5X6lu9V87/2oTVhp8y5Atd42BUGiQ5M5QiFeNGTQi0M8s7G5p0fRgEKjaylHMr Eb4MM98WHMJUsn4u+BhKMEkjuWaXmeuQk4ed2PeL0qtdx4lDgmhQHzXnmzcfQH7l8Wsd vzFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=63I96aYFr+5WWURORwCyIDTYFhVmcLyS64Ow+upFYIE=; b=WjhMZkR4AkM8ZLI33goPiKQ6C/9VZolGXFfZEoEaWFChhlpKjzgIU+m9RpdkhxB8gP nE49WFLBx/o09QQOH2pt+6znLa3+9H4W/ticqJnuipo2IPe6r/zlPsoelVIzaW9M9GsT g+huxYO29uGEuuCxc2p96laR5FuxbeQnksZNNsPeMGBKEmvQhZyEWWp3RjPqh64an3PN P/GHQca3jU3hZtHqXQ5gsrYMUDh3xrtcwCb3WkMNiDKxzn2D+73b9n2F7OOj90p82s5W T4vHufdXxXV0B+nh4PLrLbR32MIUV+brr3XVVvpuyIl5+yTK9tQK/i6YOFSXyMsA2rxx ja7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=UW2qmQyY; dkim=pass header.i=@codeaurora.org header.s=default header.b=A9bzuwie; 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 g4si1645468pfh.98.2018.03.09.15.29.49; Fri, 09 Mar 2018 15:30:04 -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=UW2qmQyY; dkim=pass header.i=@codeaurora.org header.s=default header.b=A9bzuwie; 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 S932571AbeCIX2J (ORCPT + 99 others); Fri, 9 Mar 2018 18:28:09 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:53624 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932358AbeCIXZx (ORCPT ); Fri, 9 Mar 2018 18:25:53 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 38F5D60618; Fri, 9 Mar 2018 23:25:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520637953; bh=ZwJ9ZhpOqBa0iAdseP9RGbux5OIYuaPPF0N2XGxW1RM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UW2qmQyYQ/3sDwJsC42ncbh83KfsXxfWEf10pLON1GHvdxv3vIaPX0lW1IEwj4eaz t2BlcabT7U7wGTrMcr9witdLnV517/d15YclDSo3KsT8+WahrJK9rhhq2x3jDk4o8D ZJJ4+GK4bT7lcd+QcAKZjA3CktY5Sty3D1FHs+jY= 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 codeaurora.org (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ilina@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id A0B82607F5; Fri, 9 Mar 2018 23:25:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520637952; bh=ZwJ9ZhpOqBa0iAdseP9RGbux5OIYuaPPF0N2XGxW1RM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A9bzuwie/73B2Q4rXPA24w69tKdmRxBYjbhzs8iyl/gVBRwu02vllPgW+0+f0jDad rgUGjkm8aiqAoZd1s2cvTW3uHV2ZAYorvidfnOLzbCrKLtBeHG2rxGu/k3Ped5/OwH 3S+j86RK/TsNXdHPpPOnD609EsrACchVOmAC+Ey8= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A0B82607F5 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 From: Lina Iyer To: andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org Cc: linux-soc@vger.kernel.org, rnayak@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, sboyd@kernel.org, Lina Iyer , Steven Rostedt Subject: [PATCH v4 03/10] drivers: qcom: rpmh-rsc: log RPMH requests in FTRACE Date: Fri, 9 Mar 2018 16:25:36 -0700 Message-Id: <20180309232543.24636-4-ilina@codeaurora.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180309232543.24636-1-ilina@codeaurora.org> References: <20180309232543.24636-1-ilina@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Log sent RPMH requests and interrupt responses in FTRACE. Cc: Steven Rostedt Signed-off-by: Lina Iyer --- Changes in v4: - fix compilation issues, use __assign_str - use %#x instead of 0x%08x Changes in v3: - Use __string() instead of char * - fix TRACE_INCLUDE_PATH --- drivers/soc/qcom/Makefile | 1 + drivers/soc/qcom/rpmh-rsc.c | 6 +++ drivers/soc/qcom/trace-rpmh.h | 89 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 drivers/soc/qcom/trace-rpmh.h diff --git a/drivers/soc/qcom/Makefile b/drivers/soc/qcom/Makefile index 39d3a059ee50..cb6300f6a8e9 100644 --- a/drivers/soc/qcom/Makefile +++ b/drivers/soc/qcom/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 +CFLAGS_rpmh-rsc.o := -I$(src) obj-$(CONFIG_QCOM_GLINK_SSR) += glink_ssr.o obj-$(CONFIG_QCOM_GSBI) += qcom_gsbi.o obj-$(CONFIG_QCOM_MDT_LOADER) += mdt_loader.o diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c index 8bde1e9bd599..f604101a4fc2 100644 --- a/drivers/soc/qcom/rpmh-rsc.c +++ b/drivers/soc/qcom/rpmh-rsc.c @@ -24,6 +24,9 @@ #include "rpmh-internal.h" +#define CREATE_TRACE_POINTS +#include "trace-rpmh.h" + #define RSC_DRV_TCS_OFFSET 672 #define RSC_DRV_CMD_OFFSET 20 @@ -228,6 +231,7 @@ static irqreturn_t tcs_irq_handler(int irq, void *p) /* Reclaim the TCS */ write_tcs_reg(drv, RSC_DRV_CMD_ENABLE, m, 0, 0); write_tcs_reg(drv, RSC_DRV_IRQ_CLEAR, 0, 0, BIT(m)); + trace_rpmh_notify_irq(drv, resp); clear_bit(m, drv->tcs_in_use); send_tcs_response(resp); } @@ -259,6 +263,7 @@ static void tcs_notify_tx_done(unsigned long data) } list_del(&resp->list); spin_unlock_irqrestore(&drv->drv_lock, flags); + trace_rpmh_notify_tx_done(drv, resp); free_response(resp); } } @@ -287,6 +292,7 @@ static void __tcs_buffer_write(struct rsc_drv *drv, int m, int n, write_tcs_reg(drv, RSC_DRV_CMD_MSGID, m, j, msgid); write_tcs_reg(drv, RSC_DRV_CMD_ADDR, m, j, cmd->addr); write_tcs_reg(drv, RSC_DRV_CMD_DATA, m, j, cmd->data); + trace_rpmh_send_msg(drv, m, j, msgid, cmd); } write_tcs_reg(drv, RSC_DRV_CMD_WAIT_FOR_CMPL, m, 0, cmd_complete); diff --git a/drivers/soc/qcom/trace-rpmh.h b/drivers/soc/qcom/trace-rpmh.h new file mode 100644 index 000000000000..8d7326e684db --- /dev/null +++ b/drivers/soc/qcom/trace-rpmh.h @@ -0,0 +1,89 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. + */ + +#if !defined(_TRACE_RPMH_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_RPMH_H + +#undef TRACE_SYSTEM +#define TRACE_SYSTEM rpmh + +#include +#include "rpmh-internal.h" + +DECLARE_EVENT_CLASS(rpmh_notify, + + TP_PROTO(struct rsc_drv *d, struct tcs_response *r), + + TP_ARGS(d, r), + + TP_STRUCT__entry( + __string(name, d->name) + __field(int, m) + __field(u32, addr) + __field(int, errno) + ), + + TP_fast_assign( + __assign_str(name, d->name); + __entry->m = r->m; + __entry->addr = r->msg->cmds[0].addr; + __entry->errno = r->err; + ), + + TP_printk("%s: ack: tcs-m:%d addr: %#x errno: %d", + __get_str(name), __entry->m, __entry->addr, __entry->errno) +); + +DEFINE_EVENT(rpmh_notify, rpmh_notify_irq, + TP_PROTO(struct rsc_drv *d, struct tcs_response *r), + TP_ARGS(d, r) +); + +DEFINE_EVENT(rpmh_notify, rpmh_notify_tx_done, + TP_PROTO(struct rsc_drv *d, struct tcs_response *r), + TP_ARGS(d, r) +); + + +TRACE_EVENT(rpmh_send_msg, + + TP_PROTO(struct rsc_drv *d, int m, int n, u32 h, struct tcs_cmd *c), + + TP_ARGS(d, m, n, h, c), + + TP_STRUCT__entry( + __string(name, d->name) + __field(int, m) + __field(int, n) + __field(u32, hdr) + __field(u32, addr) + __field(u32, data) + __field(bool, wait) + ), + + TP_fast_assign( + __assign_str(name, d->name); + __entry->m = m; + __entry->n = n; + __entry->hdr = h; + __entry->addr = c->addr; + __entry->data = c->data; + __entry->wait = c->wait; + ), + + TP_printk("%s: send-msg: tcs(m): %d cmd(n): %d msgid: %#x addr: %#x data: %#x complete: %d", + __get_str(name), __entry->m, __entry->n, __entry->hdr, + __entry->addr, __entry->data, __entry->wait) +); + +#endif /* _TRACE_RPMH_H */ + +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH . + +#undef TRACE_INCLUDE_FILE +#define TRACE_INCLUDE_FILE trace-rpmh + +#include -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project