Received: by 10.223.185.116 with SMTP id b49csp532938wrg; Fri, 16 Feb 2018 03:07:28 -0800 (PST) X-Google-Smtp-Source: AH8x2259tHYVHP89YbSZuKGFvUlJffKnRjZd12YFyOwZMEDrpyFbEfxdWyu+u3YsRsTSjxXAAvla X-Received: by 10.101.86.1 with SMTP id l1mr4916904pgs.140.1518779247966; Fri, 16 Feb 2018 03:07:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518779247; cv=none; d=google.com; s=arc-20160816; b=NZPQjOfeHKfuIJJAn2becS2Y8jmFtnfmIi1DzXXqkE0M/HbXddiBmFFmPKtKOjh8H6 7/NsdizwSzDQmx7ItDy3IL3sG4FWGQ0F5D66qQwYZsvRmefBHOxsOZuogMXrcQAV3yyZ KJHO2uQ5mDt7ybItsZacj5O7LAD8YvM3ID2aqgdRVnZq7vI25C+A05t6PTEPsl46BbNW LX59Dz8KMy/M8MKxPufEEVatlcai/eX3khqAmdJt+rpJ0ROJs2DrAS8XwST/DqCeCTfc aWrQ38uQ8ZQxDyBy6Nty0vU/sQiNSA1gx/qG4fqvvdpO2Zu4l8SRJbzT3T+pTY7nku/E 4o2g== 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=qPtm4tuxu4OlWvQcu9+vwiW23uPdVkju0WcZHjX13XI=; b=sfMcip7FaTA19WSZZA3/Ey55II256cgoE1D91jDqo1d1E8uIUADFJqSvqHad8FvA5Z 45m7W83wEPTT83FAqlo45uG5Al3RN/Dy1eMTo0lFTZyc7lriOCbtpyAka3P7H3Kyp+WI VHtRZ4wXJUXNPU7+rFBSnxjpwxIkbdHJ4A6RVxWFtH+43hlmNjIWUBRiCMRLVftX5B3g v8uU1bPZqTob8meAxMztHJP5huCUXzLkl/fAAJ2w4rklWkin6/jNxPf0/pWtSg58bSRd ibCBf0Qvf61+F4FxjyxpMGoXJJLNkjZWeIZUc3yaWx9UGbUKi4FsuSnR5unuAd+srMt8 ALrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=N4elGMA8; dkim=pass header.i=@codeaurora.org header.s=default header.b=P+GvuZSS; 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 y13-v6si184296plr.10.2018.02.16.03.07.01; Fri, 16 Feb 2018 03:07:27 -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=N4elGMA8; dkim=pass header.i=@codeaurora.org header.s=default header.b=P+GvuZSS; 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 S1427410AbeBORf2 (ORCPT + 99 others); Thu, 15 Feb 2018 12:35:28 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:43254 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1427384AbeBORfX (ORCPT ); Thu, 15 Feb 2018 12:35:23 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 86B3960960; Thu, 15 Feb 2018 17:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518716122; bh=sORSfeft8nkCFJb2ibapP6WPzdsTEg9Lt+aGltefFpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N4elGMA84OU5Wfwhnk3mPd/ydqU1GtxwfGA2HRm9eStCVKZlax4rhSRnu35IwBhI/ +GvFvlYR1l3fX2JpZaIQe8T/yiaPNrVz/rzDZqza9JmAYFGBXBd718bSkpNhO5vq4U VPJeqY4saiEn5zNeJ5Liy2s4ksN7A+umHyOPYNPI= 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 2DFD66079C; Thu, 15 Feb 2018 17:35:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518716121; bh=sORSfeft8nkCFJb2ibapP6WPzdsTEg9Lt+aGltefFpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P+GvuZSSk30sFpS7dEJHqw7+OVH01d1HAsV3mvSSqO6nGj8H4kb+wBSLLqnCM/W9C F2fySVfrqArG6fnvllhRID8sf7IMHs63vOG4OpPu/h4hPtX5d52gszTzLtJ5NfTyXr C1pZtEwuKeUKdopmKe9ntYKyvIj6eAjVkpwI3BcI= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2DFD66079C 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, linux-soc@vger.kernel.org Cc: rnayak@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, Lina Iyer , Steven Rostedt Subject: [PATCH v2 03/10] drivers: qcom: rpmh-rsc: log RPMH requests in FTRACE Date: Thu, 15 Feb 2018 10:35:00 -0700 Message-Id: <20180215173507.10989-4-ilina@codeaurora.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215173507.10989-1-ilina@codeaurora.org> References: <20180215173507.10989-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 --- 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 7426979ea9fb..094b639ece2f 100644 --- a/drivers/soc/qcom/Makefile +++ b/drivers/soc/qcom/Makefile @@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 +CFLAGS_trace-rpmh.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 ceb8aea237d6..58a3c53d651e 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 @@ -239,6 +242,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); atomic_set(&drv->tcs_in_use[m], 0); send_tcs_response(resp); } @@ -270,6 +274,7 @@ static void tcs_notify_tx_done(unsigned long data) struct tcs_response, list); list_del(&resp->list); spin_unlock_irqrestore(&drv->drv_lock, flags); + trace_rpmh_notify_tx_done(drv, resp); free_response(resp); } } @@ -298,6 +303,7 @@ static void __tcs_buffer_write(struct rsc_drv *drv, int m, int n, write_tcs_reg(drv, RSC_DRV_CMD_MSGID, m, n + i, msgid); write_tcs_reg(drv, RSC_DRV_CMD_ADDR, m, n + i, cmd->addr); write_tcs_reg(drv, RSC_DRV_CMD_DATA, m, n + i, cmd->data); + trace_rpmh_send_msg(drv, m, n + i, 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..734de0d54a9f --- /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( + __field(const char *, d->name) + __field(int, m) + __field(u32, addr) + __field(int, errno) + ), + + TP_fast_assign( + __entry->name = d->name; + __entry->m = r->m; + __entry->addr = r->msg->payload[0].addr; + __entry->errno = r->err; + ), + + TP_printk("%s: ack: tcs-m:%d addr: 0x%08x errno: %d", + __entry->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( + __field(const char*, d->name) + __field(int, m) + __field(int, n) + __field(u32, hdr) + __field(u32, addr) + __field(u32, data) + __field(bool, complete) + ), + + TP_fast_assign( + __entry->name = s; + __entry->m = m; + __entry->n = n; + __entry->hdr = h; + __entry->addr = c->addr; + __entry->data = c->data; + __entry->complete = c->complete; + ), + + TP_printk("%s: send-msg: tcs(m): %d cmd(n): %d msgid: 0x%08x addr: 0x%08x data: 0x%08x complete: %d", + __entry->name, __entry->m, __entry->n, __entry->hdr, + __entry->addr, __entry->data, __entry->complete) +); + +#endif /* _TRACE_RPMH_H */ + +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH ../../drivers/soc/qcom + +#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