mirror of https://github.com/wolfSSL/wolfssl.git
wolfcrypt/benchmark/benchmark.c: fix check_for_excessive_stime() to accept the algo and strength, for proper rendering on asym algs.
parent
b16bedf82a
commit
dc2ada117e
|
@ -1725,7 +1725,9 @@ static const char* bench_result_words3[][5] = {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LINUX_RUSAGE_UTIME
|
#ifdef LINUX_RUSAGE_UTIME
|
||||||
static void check_for_excessive_stime(const char *desc,
|
static void check_for_excessive_stime(const char *algo,
|
||||||
|
int strength,
|
||||||
|
const char *desc,
|
||||||
const char *desc_extra);
|
const char *desc_extra);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2518,7 +2520,7 @@ static void bench_stats_sym_finish(const char* desc, int useDeviceID,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LINUX_RUSAGE_UTIME
|
#ifdef LINUX_RUSAGE_UTIME
|
||||||
check_for_excessive_stime(desc, "");
|
check_for_excessive_stime(desc, 0, "", "");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* calculate actual bytes */
|
/* calculate actual bytes */
|
||||||
|
@ -2744,7 +2746,7 @@ static void bench_stats_asym_finish_ex(const char* algo, int strength,
|
||||||
total = current_time(0) - start;
|
total = current_time(0) - start;
|
||||||
|
|
||||||
#ifdef LINUX_RUSAGE_UTIME
|
#ifdef LINUX_RUSAGE_UTIME
|
||||||
check_for_excessive_stime(desc, desc_extra);
|
check_for_excessive_stime(algo, strength, desc, desc_extra);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GENERATE_MACHINE_PARSEABLE_REPORT
|
#ifdef GENERATE_MACHINE_PARSEABLE_REPORT
|
||||||
|
@ -14672,7 +14674,9 @@ void bench_sphincsKeySign(byte level, byte optim)
|
||||||
(double)rusage.ru_utime.tv_usec / MILLION_VALUE;
|
(double)rusage.ru_utime.tv_usec / MILLION_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void check_for_excessive_stime(const char *desc,
|
static void check_for_excessive_stime(const char *algo,
|
||||||
|
int strength,
|
||||||
|
const char *desc,
|
||||||
const char *desc_extra)
|
const char *desc_extra)
|
||||||
{
|
{
|
||||||
double start_utime = (double)base_rusage.ru_utime.tv_sec +
|
double start_utime = (double)base_rusage.ru_utime.tv_sec +
|
||||||
|
@ -14685,12 +14689,21 @@ void bench_sphincsKeySign(byte level, byte optim)
|
||||||
(double)cur_rusage.ru_stime.tv_usec / MILLION_VALUE;
|
(double)cur_rusage.ru_stime.tv_usec / MILLION_VALUE;
|
||||||
double stime_utime_ratio =
|
double stime_utime_ratio =
|
||||||
(cur_stime - start_stime) / (cur_utime - start_utime);
|
(cur_stime - start_stime) / (cur_utime - start_utime);
|
||||||
if (stime_utime_ratio > .1)
|
if (stime_utime_ratio > .1) {
|
||||||
|
if (strength > 0) {
|
||||||
printf("%swarning, "
|
printf("%swarning, "
|
||||||
"excessive system time ratio for %s%s (" FLT_FMT_PREC "%%).\n",
|
"excessive system time ratio for %s-%d-%s%s (" FLT_FMT_PREC "%%).\n",
|
||||||
err_prefix, desc, desc_extra,
|
err_prefix, algo, strength, desc, desc_extra,
|
||||||
FLT_FMT_PREC_ARGS(3, stime_utime_ratio * 100.0));
|
FLT_FMT_PREC_ARGS(3, stime_utime_ratio * 100.0));
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
printf("%swarning, "
|
||||||
|
"excessive system time ratio for %s%s%s (" FLT_FMT_PREC "%%).\n",
|
||||||
|
err_prefix, algo, desc, desc_extra,
|
||||||
|
FLT_FMT_PREC_ARGS(3, stime_utime_ratio * 100.0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#elif defined(WOLFSSL_LINUXKM)
|
#elif defined(WOLFSSL_LINUXKM)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue