diff mbox

benchtests: Fix RESULT_ACCUM macro

Message ID 20170706095702.35059-1-ashwin.sekhar@caviumnetworks.com
State New
Headers show

Commit Message

Ashwin Sekhar T K July 6, 2017, 9:57 a.m. UTC
The new and old counts are correctly given to the RESULT_ACCUM macro as
input. There is no need to add one to the new count inside the macro.

ChangeLog:
2017-07-06 Ashwin Sekhar T K <ashwin.sekhar@caviumnetworks.com>

	* scripts/bench.py (RESULT_ACCUM): Fix macro.
---
 benchtests/scripts/bench.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/benchtests/scripts/bench.py b/benchtests/scripts/bench.py
index 8c1c9eeb2b..20d8682074 100755
--- a/benchtests/scripts/bench.py
+++ b/benchtests/scripts/bench.py
@@ -83,7 +83,7 @@  struct _variants variants[%(num_variants)d] = {
 EPILOGUE = '''
 #define RESULT(__v, __i) (variants[(__v)].in[(__i)].timing)
 #define RESULT_ACCUM(r, v, i, old, new) \\
-        ((RESULT ((v), (i))) = (RESULT ((v), (i)) * (old) + (r)) / ((new) + 1))
+        ((RESULT ((v), (i))) = (RESULT ((v), (i)) * (old) + (r)) / (new))
 #define BENCH_FUNC(i, j) ({%(getret)s CALL_BENCH_FUNC (i, j);})
 #define FUNCNAME "%(func)s"
 #include "bench-skeleton.c"'''