From patchwork Thu May 19 17:39:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9128017 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 163D360221 for ; Thu, 19 May 2016 17:40:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AF82281B3 for ; Thu, 19 May 2016 17:40:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2A2B281BA; Thu, 19 May 2016 17:40:04 +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.9 required=2.0 tests=BAYES_00,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 7036B281B3 for ; Thu, 19 May 2016 17:40:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754620AbcESRkD (ORCPT ); Thu, 19 May 2016 13:40:03 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58732 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754342AbcESRkC (ORCPT ); Thu, 19 May 2016 13:40:02 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 82AD3613D4; Thu, 19 May 2016 17:40:01 +0000 (UTC) Received: from [10.228.68.100] (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id D8E58613D2; Thu, 19 May 2016 17:39:59 +0000 (UTC) Subject: Re: Dmatest Behavior To: Dan Williams References: <5739E754.2030505@codeaurora.org> <20160517162844.GU23734@localhost> <573B4C39.50902@codeaurora.org> Cc: Vinod Koul , "dmaengine@vger.kernel.org" From: Sinan Kaya Message-ID: <573DFA6E.7060406@codeaurora.org> Date: Thu, 19 May 2016 13:39:58 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is what I put together yesterday. I also want to show the amount of time spent in DMA map and unmap calls and remove it from the runtime cost too. Comments welcome. >> I have testers and customers opening a bug case to me saying that we are >> not reaching to performance numbers advertised. I have to carefully explain >> them that the test is not correct and they are resisting. > > Ah, sorry about that. If they're reading this thread, "Listen to Sinan!!!" > >> I want to remove this ambiguity. > > Sounds good to me. > From ec9f4480fac1648e9f53112b143a535774e3795d Mon Sep 17 00:00:00 2001 From: Sinan Kaya Date: Wed, 18 May 2016 16:57:15 -0400 Subject: [PATCH] dmatest: exclude compare and fill time during performance report Change-Id: I3428a85c3a58f990b985fc10fe736dfb3e56b206 Signed-off-by: Sinan Kaya --- drivers/dma/dmatest.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index b8576fd..0b3e1f9 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c @@ -416,7 +416,9 @@ static int dmatest_func(void *data) int src_cnt; int dst_cnt; int i; - ktime_t ktime; + ktime_t ktime, start, diff; + ktime_t filltime = ktime_set(0, 0); + ktime_t comparetime = ktime_set(0, 0); s64 runtime = 0; unsigned long long total_len = 0; @@ -517,6 +519,7 @@ static int dmatest_func(void *data) src_off = 0; dst_off = 0; } else { + start = ktime_get(); src_off = dmatest_random() % (params->buf_size - len + 1); dst_off = dmatest_random() % (params->buf_size - len + 1); @@ -527,6 +530,9 @@ static int dmatest_func(void *data) params->buf_size); dmatest_init_dsts(thread->dsts, dst_off, len, params->buf_size); + + diff = ktime_sub(ktime_get(), start); + filltime = ktime_add(filltime, diff); } um = dmaengine_get_unmap_data(dev->dev, src_cnt+dst_cnt, @@ -657,6 +663,7 @@ static int dmatest_func(void *data) continue; } + start = ktime_get(); pr_debug("%s: verifying source buffer...\n", current->comm); error_count = dmatest_verify(thread->srcs, 0, src_off, 0, PATTERN_SRC, true); @@ -677,6 +684,9 @@ static int dmatest_func(void *data) params->buf_size, dst_off + len, PATTERN_DST, false); + diff = ktime_sub(ktime_get(), start); + comparetime = ktime_add(comparetime, diff); + if (error_count) { result("data error", total_tests, src_off, dst_off, len, error_count); @@ -686,7 +696,10 @@ static int dmatest_func(void *data) dst_off, len, 0); } } - runtime = ktime_us_delta(ktime_get(), ktime); + ktime = ktime_sub(ktime_get(), ktime); + ktime = ktime_sub(ktime, comparetime); + ktime = ktime_sub(ktime, filltime); + runtime = ktime_to_us(ktime); ret = 0; err_dstbuf: