Received: by 10.223.185.116 with SMTP id b49csp8836259wrg; Fri, 2 Mar 2018 08:45:24 -0800 (PST) X-Google-Smtp-Source: AG47ELvjfwmxTR+g+kIDSRey7ZiQssDjJ4VNhu5iSnEYqusqD4cdQ/fg8ATiup0dVOjrF67MYy3C X-Received: by 2002:a17:902:1a4:: with SMTP id b33-v6mr5657902plb.321.1520009124445; Fri, 02 Mar 2018 08:45:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520009124; cv=none; d=google.com; s=arc-20160816; b=Ay5oCMEkFFSYqeVFyDwEYg8eQUZyVUvPphAuHgTrVadrQPGTn/jo+v3hRQEzWv/W+F RqpyKVHDl2GmpOCIS0qZN8AOKFOhLBG7msP86gYxmuCz7MzCgz9N6GKzdwRxg58F22wu OZPeTzIWWRc+sN+kvZsht1m8NWiyiWPD8Ep8LO0DC9LN6R9W+BpkWXJI3PyLVt/sGKKb 0/CkME29+zEB/pZkvPajkf4yvWcqAUUGlsu02kWaThPjmstWpm5PPgj4Xbbr7laE/bB5 +CasO3iDWs/L5QKxAKCmXscE9SHk8Fui1EpnC6jG+J8gC25iXUaPLoLU/9YehM6NHYM9 dPBA== 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=/l4ugPyIyKm+VhwpdA/Y/TrYn1isXy9PFRUAwyzWmkU=; b=ogChfgh0PaXINvT1/bS9jQuz5A76hsF5Fezf6MP99MG/wbGj9ZyEmu37a8tBcQSXkA D5D3gmZSft7pjEC3gJl+yWRwrN2YbNORAcseYdZguCHgW4bYwBhy40/qu7n8EHDPCm8o lrRvqPKGQXTuKhmymrJAKsKn8fijh7+j6Ga86yYxnOishaIJHWEjvbE4+iljQMcDK8g0 mX43mjoND85/K5Bgr0rAqJ1q7s+ukX8Jls4hZLipCP0lXfaM1bI8K85nDh9zdnLeUKYt K8dNQIpEhEOulJQBzd+tLAegyrNLn7iHvXMzJd5OB0zEXe1r70v+LPbZDx0SsW/niDnb UMlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=DnPOFiVR; dkim=pass header.i=@codeaurora.org header.s=default header.b=M2s6J5sQ; 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 b59-v6si5039081plb.529.2018.03.02.08.45.09; Fri, 02 Mar 2018 08:45:24 -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=DnPOFiVR; dkim=pass header.i=@codeaurora.org header.s=default header.b=M2s6J5sQ; 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 S1161226AbeCBQns (ORCPT + 99 others); Fri, 2 Mar 2018 11:43:48 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:40896 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967977AbeCBQnf (ORCPT ); Fri, 2 Mar 2018 11:43:35 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5DB5860767; Fri, 2 Mar 2018 16:43:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520009015; bh=azUF5DSNdO8jztdXpPRwLQdwMy/kYnFqkm/7T23/mAE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DnPOFiVRNxv4REsi2IKRXQRVubFB72SWFGUJAacSKE4VuisS710B/85CUwRkcd4rB xjEPCu3ZoPVveiWjmwI0gMov831epTcImfoE1Z9IV2NMHD77Xw77QbJgNQGUEgdD7k eB9v5HZMhf8KXlyWQTB71FV0d9kNJAO3Niz5AM7g= 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 A37566072E; Fri, 2 Mar 2018 16:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520009014; bh=azUF5DSNdO8jztdXpPRwLQdwMy/kYnFqkm/7T23/mAE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M2s6J5sQ0KQnR+rZ9dYscG9cJVZzRL59vnpw+duNuPmJywXUVhTlaXFHDVg7f59X8 w2Iev4oIny1ya1Yet0RvAqn6Tg9eWjQgqa7fXq9OEmz4Ays2FMjvYuf/RXLuHBBzZ5 ZApIXJQ6kBlFv+wfyYCrOPM6YXiQMIaJEx4q8un4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A37566072E 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 v3 03/10] drivers: qcom: rpmh-rsc: log RPMH requests in FTRACE Date: Fri, 2 Mar 2018 09:43:10 -0700 Message-Id: <20180302164317.10554-4-ilina@codeaurora.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180302164317.10554-1-ilina@codeaurora.org> References: <20180302164317.10554-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 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 e7d04f0e3616..bb013d56b5a1 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 6cb91a0114ee..4322e23a2ba6 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, 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..b23ad8457224 --- /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_string(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", + __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, complete) + ), + + TP_fast_assign( + __assign_string(name, d->name); + __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", + __get_str(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 . + +#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