All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sinan Kaya <okaya@codeaurora.org>
To: dmaengine@vger.kernel.org, timur@codeaurora.org, cov@codeaurora.org
Cc: linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] dmenginer: dmatest: exclude compare and fill time during perf report
Date: Mon, 18 Jul 2016 10:10:46 -0400	[thread overview]
Message-ID: <91cef2f6-b223-182a-e4aa-64cd26337e78@codeaurora.org> (raw)
In-Reply-To: <1468849977-28538-1-git-send-email-okaya@codeaurora.org>

Sorry for the typo at the commit summary. Fat fingers...


On 7/18/2016 9:52 AM, Sinan Kaya wrote:
> Dmatest is currently including compare and fill time into the
> calculated performance numbers. This does not reflect the HW
> capability and the results vary based on the transfer sizes used.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  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:
> 


-- 
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.

WARNING: multiple messages have this Message-ID (diff)
From: okaya@codeaurora.org (Sinan Kaya)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2] dmenginer: dmatest: exclude compare and fill time during perf report
Date: Mon, 18 Jul 2016 10:10:46 -0400	[thread overview]
Message-ID: <91cef2f6-b223-182a-e4aa-64cd26337e78@codeaurora.org> (raw)
In-Reply-To: <1468849977-28538-1-git-send-email-okaya@codeaurora.org>

Sorry for the typo at the commit summary. Fat fingers...


On 7/18/2016 9:52 AM, Sinan Kaya wrote:
> Dmatest is currently including compare and fill time into the
> calculated performance numbers. This does not reflect the HW
> capability and the results vary based on the transfer sizes used.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  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:
> 


-- 
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.

  reply	other threads:[~2016-07-18 14:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18 13:52 [PATCH V2] dmenginer: dmatest: exclude compare and fill time during perf report Sinan Kaya
2016-07-18 13:52 ` Sinan Kaya
2016-07-18 14:10 ` Sinan Kaya [this message]
2016-07-18 14:10   ` Sinan Kaya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91cef2f6-b223-182a-e4aa-64cd26337e78@codeaurora.org \
    --to=okaya@codeaurora.org \
    --cc=cov@codeaurora.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=timur@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.