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:
@ -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:
|
||||
|
Reference in New Issue
Block a user