bench-slope: add CPU frequency auto-detection
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Thu, 22 Mar 2018 19:42:23 +0000 (21:42 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Thu, 22 Mar 2018 19:42:23 +0000 (21:42 +0200)
commit617f5e746f8295cc36d1002c8c53edc95d04d0f6
tree9f554e7035831f3c246ef0d5bbb44382ac0832d3
parent3841b23c0ccb24d555b7570083bba958e3126d26
bench-slope: add CPU frequency auto-detection

* tests/bench-slope.c (bench_obj): Add 'hd'.
(bench_encrypt_init, bench_encrypt_free, bench_encrypt_do_bench)
(bench_decrypt_do_bench, bench_xts_encrypt_init)
(bench_xts_encrypt_do_bench, bench_xts_decrypt_do_bench)
(bench_ccm_encrypt_init, bench_ccm_encrypt_do_bench)
(bench_ccm_decrypt_do_bench, bench_aead_encrypt_init)
(bench_aead_encrypt_do_bench, bench_aead_decrypt_do_bench)
(bench_hash_init, bench_hash_free, bench_hash_do_bench)
(bench_mac_init, bench_mac_free, bench_mac_do_bench): Use 'obj->hd'
for storing pointer to crypto context.
(auto_ghz): New.
(do_slope_benchmark): Rename to...
(slope_benchmark): ...this.
(auto_ghz_init, auto_ghz_free, auto_ghz_bench, auto_ghz_detect_ops)
(get_auto_ghz, do_slope_benchmark): New.
(double_to_str): Round number larger than 1000 to integer.
(bench_print_result_csv, bench_print_result_std)
(bench_print_result, bench_print_header, cipher_bench_one)
(hash_bench_one, mac_bench_one, kdf_bench_one, kdf_bench): Add
auto-detected frequency printing.
(print_help): Help for CPU speed auto-detection mode.
(main): Add parsing for "--cpu-mhz auto".
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
tests/bench-slope.c