From patchwork Fri Jan 19 00:01:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 10174281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6F54B602B8 for ; Fri, 19 Jan 2018 00:03:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F9CA1FF62 for ; Fri, 19 Jan 2018 00:03:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5461C2842B; Fri, 19 Jan 2018 00:03:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F9381FF62 for ; Fri, 19 Jan 2018 00:03:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755285AbeASADm (ORCPT ); Thu, 18 Jan 2018 19:03:42 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:54932 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755178AbeASADL (ORCPT ); Thu, 18 Jan 2018 19:03:11 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BE2476081E; Fri, 19 Jan 2018 00:03:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516320190; bh=POZlPXvIDN5IoD8Fc5teDJsFclle8ewDOVGtzAKNVSc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UUYSnXcai/EKizmOQ4GFsegkpVwaIveW0ylYbFRYEqWK4fe4Vp0eoXUZIoOFAQE89 SR1nZ0yF5K3W0XsgPpzhBLgiLSgbtinYzjYq77u637FvUiPzsfMlykGJObvxeiJzpW DgJ5Bdn9slRaTFgQsUOvD/PRLhpxdRA5nCaGSrmQ= 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 5E6DD6081E; Fri, 19 Jan 2018 00:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1516320181; bh=POZlPXvIDN5IoD8Fc5teDJsFclle8ewDOVGtzAKNVSc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ktl2oZNQ5kkc3GhSeJ6PJMgJs0a0x0EhryWETH427cGP9cwMqRYLVyZKFrxH1J9HY BGGkkbbgsDZ6tF3qfNaZPqyagx0q7woy6YxC+lyIaF8dcj0dupu/sI/7XgbZA8xpnL hASJAutlJ4kCb0GtkSGIP1/g4kI+4vqrzUi1Odok= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5E6DD6081E 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 Cc: sboyd@codeaurora.org, rnayak@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-pm@vger.kernel.org, Lina Iyer , Steven Rostedt Subject: [PATCH 3/4] drivers: qcom: rpmh-rsc: log RPMH requests in FTRACE Date: Thu, 18 Jan 2018 17:01:56 -0700 Message-Id: <20180119000157.7380-4-ilina@codeaurora.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180119000157.7380-1-ilina@codeaurora.org> References: <20180119000157.7380-1-ilina@codeaurora.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Log sent RPMH requests and interrupt responses in FTRACE. Cc: Steven Rostedt Signed-off-by: Lina Iyer --- drivers/soc/qcom/rpmh-rsc.c | 13 ++++++- include/trace/events/rpmh.h | 89 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 include/trace/events/rpmh.h diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c index 3e68cef5513e..424dc939b2e6 100644 --- a/drivers/soc/qcom/rpmh-rsc.c +++ b/drivers/soc/qcom/rpmh-rsc.c @@ -33,6 +33,9 @@ #include "rpmh-internal.h" +#define CREATE_TRACE_POINTS +#include + #define MAX_CMDS_PER_TCS 16 #define MAX_TCS_PER_TYPE 3 @@ -325,6 +328,8 @@ static irqreturn_t tcs_irq_handler(int irq, void *p) } } + trace_rpmh_notify_irq(drv->name, m, resp->msg->payload[0].addr, + resp->err); write_tcs_reg(base, RSC_DRV_CMD_ENABLE, m, 0, 0); write_tcs_reg(base, RSC_DRV_IRQ_CLEAR, 0, 0, BIT(m)); atomic_set(&drv->tcs_in_use[m], 0); @@ -351,7 +356,8 @@ static void tcs_notify_tx_done(unsigned long data) struct rsc_drv *drv = (struct rsc_drv *)data; struct tcs_response *resp; unsigned long flags; - int err; + int err, m; + struct tcs_mbox_msg *msg; do { spin_lock_irqsave(&drv->drv_lock, flags); @@ -364,7 +370,10 @@ static void tcs_notify_tx_done(unsigned long data) list_del(&resp->list); spin_unlock_irqrestore(&drv->drv_lock, flags); err = resp->err; + m = resp->m; + msg = resp->msg; free_response(resp); + trace_rpmh_notify(drv->name, m, msg->payload[0].addr, err); } while (1); } @@ -393,6 +402,8 @@ static void __tcs_buffer_write(struct rsc_drv *drv, int m, int n, write_tcs_reg(base, RSC_DRV_CMD_MSGID, m, n + i, msgid); write_tcs_reg(base, RSC_DRV_CMD_ADDR, m, n + i, cmd->addr); write_tcs_reg(base, RSC_DRV_CMD_DATA, m, n + i, cmd->data); + trace_rpmh_send_msg(drv->name, m, n + i, msgid, cmd->addr, + cmd->data, cmd->complete); } write_tcs_reg(base, RSC_DRV_CMD_WAIT_FOR_CMPL, m, 0, cmd_complete); diff --git a/include/trace/events/rpmh.h b/include/trace/events/rpmh.h new file mode 100644 index 000000000000..2cc44fc5ff95 --- /dev/null +++ b/include/trace/events/rpmh.h @@ -0,0 +1,89 @@ +/* Copyright (c) 2016-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 rpmh + +#if !defined(_TRACE_RPMH_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_RPMH_H + +#include + +DECLARE_EVENT_CLASS(rpmh_ack_recvd, + + TP_PROTO(const char *s, int m, u32 addr, int errno), + + TP_ARGS(s, m, addr, errno), + + TP_STRUCT__entry( + __field(const char *, name) + __field(int, m) + __field(u32, addr) + __field(int, errno) + ), + + TP_fast_assign( + __entry->name = s; + __entry->m = m; + __entry->addr = addr; + __entry->errno = errno; + ), + + TP_printk("%s: ack: tcs-m:%d addr: 0x%08x errno: %d", + __entry->name, __entry->m, __entry->addr, __entry->errno) +); + +DEFINE_EVENT(rpmh_ack_recvd, rpmh_notify_irq, + TP_PROTO(const char *s, int m, u32 addr, int err), + TP_ARGS(s, m, addr, err) +); + +DEFINE_EVENT(rpmh_ack_recvd, rpmh_notify, + TP_PROTO(const char *s, int m, u32 addr, int err), + TP_ARGS(s, m, addr, err) +); + +TRACE_EVENT(rpmh_send_msg, + + TP_PROTO(const char *s, int m, int n, u32 h, u32 a, u32 v, bool c), + + TP_ARGS(s, m, n, h, a, v, c), + + TP_STRUCT__entry( + __field(const char*, 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 = a; + __entry->data = v; + __entry->complete = c; + ), + + 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 */ + +#define TRACE_INCLUDE_FILE rpmh +#include