This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] benchtests: Fix RESULT_ACCUM macro
- From: Ashwin Sekhar T K <ashwin dot sekhar at caviumnetworks dot com>
- To: libc-alpha at sourceware dot org
- Cc: Ashwin Sekhar T K <ashwin dot sekhar at caviumnetworks dot com>
- Date: Thu, 6 Jul 2017 02:57:02 -0700
- Subject: [PATCH] benchtests: Fix RESULT_ACCUM macro
- Authentication-results: sourceware.org; auth=none
- Authentication-results: sourceware.org; dkim=none (message not signed) header.d=none;sourceware.org; dmarc=none action=none header.from=caviumnetworks.com;
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
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 --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"'''
--
2.12.2