apps/speed: fix invalid final report when run SM2 benchmarks in parallel

Fixed #11523
CLA: trivial

Signed-off-by: 张盛豪 <zhangshenghao1995@163.com>

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
(Merged from https://github.com/openssl/openssl/pull/11557)
This commit is contained in:
张盛豪 2020-04-16 22:34:24 +08:00 committed by Paul Yang
parent ad16671d49
commit 031c9bd3f3

View File

@ -3467,7 +3467,7 @@ int speed_main(int argc, char **argv)
d = Time_F(STOP);
BIO_printf(bio_err,
mr ? "+R8:%ld:%u:%s:%.2f\n" :
mr ? "+R10:%ld:%u:%s:%.2f\n" :
"%ld %u bits %s signs in %.2fs \n",
count, sm2_curves[testnum].bits,
sm2_curves[testnum].name, d);
@ -3496,7 +3496,7 @@ int speed_main(int argc, char **argv)
count = run_benchmark(async_jobs, SM2_verify_loop, loopargs);
d = Time_F(STOP);
BIO_printf(bio_err,
mr ? "+R9:%ld:%u:%s:%.2f\n"
mr ? "+R11:%ld:%u:%s:%.2f\n"
: "%ld %u bits %s verify in %.2fs\n",
count, sm2_curves[testnum].bits,
sm2_curves[testnum].name, d);
@ -3678,7 +3678,7 @@ int speed_main(int argc, char **argv)
}
if (mr)
printf("+F6:%u:%u:%s:%f:%f\n",
printf("+F7:%u:%u:%s:%f:%f\n",
k, sm2_curves[k].bits, sm2_curves[k].name,
sm2_results[k][0], sm2_results[k][1]);
else
@ -3974,6 +3974,7 @@ static int do_multi(int multi, int size_num)
p = buf + 4;
k = atoi(sstrsep(&p, sep));
sstrsep(&p, sep);
sstrsep(&p, sep);
d = atof(sstrsep(&p, sep));
sm2_results[k][0] += d;