Received: by 10.213.65.68 with SMTP id h4csp2125962imn; Thu, 5 Apr 2018 09:22:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx496UutEY+qFRjiimYPSLvtl5u+/8Jx6ZtCQkdGE9V+ECPrU7avvQCZ6VKEqpOyGazrAEGvG X-Received: by 2002:a17:902:274a:: with SMTP id j10-v6mr23015072plg.28.1522945361647; Thu, 05 Apr 2018 09:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522945361; cv=none; d=google.com; s=arc-20160816; b=zxYRkkl0y0/osKyHbQq5wklI2BqtSqP18XVrKrpeXC+hATRIJNKuo+af47hS2EM/V6 9FUhmqj0dYW+hJrVxPLMpaeBe0p3b3LqITNGxqvT+uFCkgJkmdVQd220FMUa/QjI544+ YPziujlmYUP8c4B1IZYRGishhMnH4qyJyfdvIyDi1/AtgLQJoBhdrqwJCMND4qeXPCXU yKCEr4acKxSE40OYbA5Y2219zU3GUB74C1TtLRrBVYGtn0HnOZ8w9o9XgM3jDjC7UkrJ 89k5pKZ6fAWCBsX+5XbZUb2bj8XPyVJ0z18aNXHE8k57DzAfGxgjH14FIeh6KXiX00Rb ORNg== 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=2A/Ez+NDCdPWwIp44HyCfAkPEICkQsM5AapFY7tYHBA=; b=G/k/o0wq3fq/HldIKWFXg+q8FwanE2SV/7rWSbsfKVdA/ma66DWlrDJIHlZHPw9tmE 401Uno55F40wxL1GFSrhtPLNX97FkotM+tik3A7coP1oBsv2Vx3cN3YbPNXuI60Z2Ico StQEGUgY8oykz24vmzaRDuFFDD4TbZGehPLGIwldySZ7+Z605JTxg6aAsunfbbusaLQ1 EzoWxRotOIZXZpB1kutJxhng+sm0VTU9HVZjh3e4KDlwJAUULUt/LkbhmqE6QaSvphwK 85AdrA4+S9vKvBifqRw00LBofHrWz9rwR/34+LBLJ05yymslR6C9W1q/lJ5B+3JVq1V/ H72Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=EbkU+p4b; dkim=pass header.i=@codeaurora.org header.s=default header.b=i8C66QIG; 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 ay8-v6si5785118plb.554.2018.04.05.09.22.27; Thu, 05 Apr 2018 09:22:41 -0700 (PDT) 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=EbkU+p4b; dkim=pass header.i=@codeaurora.org header.s=default header.b=i8C66QIG; 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 S1752110AbeDEQSu (ORCPT + 99 others); Thu, 5 Apr 2018 12:18:50 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:41634 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751730AbeDEQSp (ORCPT ); Thu, 5 Apr 2018 12:18:45 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2A46E607E5; Thu, 5 Apr 2018 16:18:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522945125; bh=2Ihq2Ih1aH4UDtgj0WIzy1WGpHunN7A+m32Mvc4Gv2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EbkU+p4bT2wXEps88Bv6FxCQ9/ehvWwzJbGNXanP3V8OQyUAw+K+66GQGG+UgrUXh P1d4R/W0NOddX5nqup7f7bjhb4q8Jy+NM1KDdV0P7+MG0sUxWPNufZhezYBm37Itiy jsVLdEcw3o2D+XPpT7UEurJbqd3PtEirEYzEn7S4= 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 8205460C65; Thu, 5 Apr 2018 16:18:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522945123; bh=2Ihq2Ih1aH4UDtgj0WIzy1WGpHunN7A+m32Mvc4Gv2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i8C66QIG/3Sw2Iumzbn1MEHqBhDeCGto4nvpdzALwTgZHaK7A52h2viL84OrEUeuv S4qAwDfd/4dvukOBfAeKQ4AmTJTgIFQpazHICzwwj1g8TbE4GXLB7b21/RaQar4+A2 tW+09U6n2+CJOP5yePwbJ9f79+DYwNHfauMs/Z5E= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8205460C65 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, sboyd@kernel.org, evgreen@chromium.org, dianders@chromium.org, Lina Iyer , Steven Rostedt Subject: [PATCH v5 03/10] drivers: qcom: rpmh-rsc: log RPMH requests in FTRACE Date: Thu, 5 Apr 2018 10:18:27 -0600 Message-Id: <20180405161834.3850-4-ilina@codeaurora.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180405161834.3850-1-ilina@codeaurora.org> References: <20180405161834.3850-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 Reviewed-by: Steven Rostedt (VMware) --- 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