aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSinan Kaya <okaya@codeaurora.org>2016-09-01 10:02:55 -0400
committerVinod Koul <vinod.koul@intel.com>2016-09-02 07:07:04 -0400
commite9405ef08ca8d9e702f4a1b58b4fa992a7c9f137 (patch)
treeaa1cb9acc03e3e68d7b126259a18f29f2dd8f3ea
parent29b4817d4018df78086157ea3a55c1d9424a7cfc (diff)
dmaengine: dmatest: exclude compare and fill time during perf report
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 CPU speed instead of the HW speed. Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/dmatest.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index 1245db5438e1..738fbd1dd57a 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -426,7 +426,9 @@ static int dmatest_func(void *data)
426 int src_cnt; 426 int src_cnt;
427 int dst_cnt; 427 int dst_cnt;
428 int i; 428 int i;
429 ktime_t ktime; 429 ktime_t ktime, start, diff;
430 ktime_t filltime = ktime_set(0, 0);
431 ktime_t comparetime = ktime_set(0, 0);
430 s64 runtime = 0; 432 s64 runtime = 0;
431 unsigned long long total_len = 0; 433 unsigned long long total_len = 0;
432 434
@@ -531,6 +533,7 @@ static int dmatest_func(void *data)
531 src_off = 0; 533 src_off = 0;
532 dst_off = 0; 534 dst_off = 0;
533 } else { 535 } else {
536 start = ktime_get();
534 src_off = dmatest_random() % (params->buf_size - len + 1); 537 src_off = dmatest_random() % (params->buf_size - len + 1);
535 dst_off = dmatest_random() % (params->buf_size - len + 1); 538 dst_off = dmatest_random() % (params->buf_size - len + 1);
536 539
@@ -541,6 +544,9 @@ static int dmatest_func(void *data)
541 params->buf_size); 544 params->buf_size);
542 dmatest_init_dsts(thread->dsts, dst_off, len, 545 dmatest_init_dsts(thread->dsts, dst_off, len,
543 params->buf_size); 546 params->buf_size);
547
548 diff = ktime_sub(ktime_get(), start);
549 filltime = ktime_add(filltime, diff);
544 } 550 }
545 551
546 um = dmaengine_get_unmap_data(dev->dev, src_cnt+dst_cnt, 552 um = dmaengine_get_unmap_data(dev->dev, src_cnt+dst_cnt,
@@ -683,6 +689,7 @@ static int dmatest_func(void *data)
683 continue; 689 continue;
684 } 690 }
685 691
692 start = ktime_get();
686 pr_debug("%s: verifying source buffer...\n", current->comm); 693 pr_debug("%s: verifying source buffer...\n", current->comm);
687 error_count = dmatest_verify(thread->srcs, 0, src_off, 694 error_count = dmatest_verify(thread->srcs, 0, src_off,
688 0, PATTERN_SRC, true); 695 0, PATTERN_SRC, true);
@@ -703,6 +710,9 @@ static int dmatest_func(void *data)
703 params->buf_size, dst_off + len, 710 params->buf_size, dst_off + len,
704 PATTERN_DST, false); 711 PATTERN_DST, false);
705 712
713 diff = ktime_sub(ktime_get(), start);
714 comparetime = ktime_add(comparetime, diff);
715
706 if (error_count) { 716 if (error_count) {
707 result("data error", total_tests, src_off, dst_off, 717 result("data error", total_tests, src_off, dst_off,
708 len, error_count); 718 len, error_count);
@@ -712,7 +722,10 @@ static int dmatest_func(void *data)
712 dst_off, len, 0); 722 dst_off, len, 0);
713 } 723 }
714 } 724 }
715 runtime = ktime_us_delta(ktime_get(), ktime); 725 ktime = ktime_sub(ktime_get(), ktime);
726 ktime = ktime_sub(ktime, comparetime);
727 ktime = ktime_sub(ktime, filltime);
728 runtime = ktime_to_us(ktime);
716 729
717 ret = 0; 730 ret = 0;
718err_dstbuf: 731err_dstbuf: