1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

benchtests: Add new directive for benchmark initialization hook

Add a new 'init' directive that specifies the name of the function to
call to do function-specific initialization.  This is useful for
benchmarks that need to do a one-time initialization before the
functions are executed.
This commit is contained in:
Siddhesh Poyarekar
2014-02-22 10:09:27 +05:30
parent 75f11331f9
commit 15eaf6ffe3
4 changed files with 18 additions and 1 deletions

View File

@ -128,6 +128,10 @@ def gen_source(func, directives, all_vals):
else:
getret = ''
# Test initialization.
if directives['init']:
print('#define BENCH_INIT %s' % directives['init'])
print(EPILOGUE % {'getret': getret, 'func': func})
@ -232,7 +236,8 @@ def parse_file(func):
'args': [],
'includes': [],
'include-sources': [],
'ret': ''
'ret': '',
'init': ''
}
try: