From patchwork Wed Oct 31 16:03:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 10662881 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BE98E46E4 for ; Wed, 31 Oct 2018 16:03:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABBA62B249 for ; Wed, 31 Oct 2018 16:03:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CB552B259; Wed, 31 Oct 2018 16:03:19 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 1133C2B234 for ; Wed, 31 Oct 2018 16:03:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729757AbeKABBz (ORCPT ); Wed, 31 Oct 2018 21:01:55 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:53434 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729711AbeKABBy (ORCPT ); Wed, 31 Oct 2018 21:01:54 -0400 Received: from [148.252.241.226] (helo=rainbowdash) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1gHsxc-0005li-Hg; Wed, 31 Oct 2018 16:03:12 +0000 Received: from ben by rainbowdash with local (Exim 4.91) (envelope-from ) id 1gHsxc-0005Kx-6s; Wed, 31 Oct 2018 16:03:12 +0000 From: Ben Dooks To: dan.j.williams@intel.com, vkoul@kernel.org Cc: ldewangan@nvidia.com, dmaengine@vger.kernel.org, linux-tegra@vger.kernel.org, Ben Dooks , Ingo Molnar , Steven Rostedt Subject: [PATCH 6/6] dma: tegra: add tracepoint for residual update Date: Wed, 31 Oct 2018 16:03:09 +0000 Message-Id: <20181031160309.20408-7-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181031160309.20408-1-ben.dooks@codethink.co.uk> References: <20181031160309.20408-1-ben.dooks@codethink.co.uk> MIME-Version: 1.0 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a tracepoint in the residual update instead of using dev_dbg() to allow debugging via the trace pipe. Signed-off-by: Ben Dooks --- Fixes since v1: - copy the devname instead of referencing the dmachan device Cc: Ingo Molnar (maintainer:TRACING) Cc: Steven Rostedt (maintainer:TRACING) --- drivers/dma/tegra20-apb-dma.c | 5 ++--- include/trace/events/tegra_apb_dma.h | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index 22114c9a6e98..211efea67db6 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c @@ -886,9 +886,8 @@ static unsigned int tegra_dma_update_residual(struct tegra_dma_channel *tdc, } done: - dev_dbg(tdc2dev(tdc), "residual: req %08lx, ahb@%08lx, wcount %08lx, done %d\n", - sg_req->ch_regs.ahb_ptr, ahbptr, wcount, done); - + trace_tegra_dma_tx_state(&tdc->dma_chan, ahbptr, status, result, + tmp, residual); return result; } diff --git a/include/trace/events/tegra_apb_dma.h b/include/trace/events/tegra_apb_dma.h index 1f55c2c6049d..8fa0f0974828 100644 --- a/include/trace/events/tegra_apb_dma.h +++ b/include/trace/events/tegra_apb_dma.h @@ -41,6 +41,33 @@ TRACE_EVENT(tegra_dma_complete_cb, __get_str(chan), __entry->count, __entry->ptr) ); +TRACE_EVENT(tegra_dma_tx_state, + TP_PROTO(struct dma_chan *dc, unsigned long ahb, + unsigned long wc, unsigned int done, + unsigned long byte_count, unsigned int residual), + TP_ARGS(dc, ahb, wc, done, byte_count, residual), + TP_STRUCT__entry( + __string(chan, 16) + __field(unsigned long, ahb) + __field(unsigned long, wc) + __field(unsigned long, done) + __field(unsigned int, residual) + __field(unsigned long, byte_count) + ), + TP_fast_assign( + __assign_str(chan, dev_name(&dc->dev->device)); + __entry->ahb = ahb; + __entry->wc = wc; + __entry->done = done; + __entry->residual = residual; + __entry->byte_count = byte_count; + ), + TP_printk("%s: txresidual: ahb %08lx wc %08lx => done %lu bc %lu residual %u", + __get_str(chan), + __entry->ahb, __entry->wc, __entry->done, + __entry->byte_count, __entry->residual) +); + TRACE_EVENT(tegra_dma_isr, TP_PROTO(struct dma_chan *dc, int irq), TP_ARGS(dc, irq),