diff options
author | Burt P <pburt0@gmail.com> | 2017-12-22 20:20:03 -0600 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2018-02-27 07:41:51 -0800 |
commit | 0790540798a4c71b923888b201e94615c64a04af (patch) | |
tree | af6ab9afcf11fe0f22c1b5b6c9922d604e7cd673 /modules/benchmark/bench_results.c | |
parent | c24ec9dc276d76684bcc2538e6e218a9b58ea346 (diff) |
bench_results: store complete bench_value
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/benchmark/bench_results.c')
-rw-r--r-- | modules/benchmark/bench_results.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/benchmark/bench_results.c b/modules/benchmark/bench_results.c index 6c3f1c75..27a33a65 100644 --- a/modules/benchmark/bench_results.c +++ b/modules/benchmark/bench_results.c @@ -255,7 +255,10 @@ bench_result *bench_result_benchmarkconf(const char *section, const char *key, c if (vl >= 10) { /* the 11th could be empty */ b->machine->mid = strdup(key); - b->bvalue.result = atof(values[0]); + /* first try as bench_value, then try as double 'result' only */ + b->bvalue = bench_value_from_str(values[0]); + if (b->bvalue.result == -1) + b->bvalue.result = atoi(values[0]); b->bvalue.threads_used = atoi(values[1]); b->machine->board = strdup(values[2]); b->machine->cpu_name = strdup(values[3]); @@ -344,8 +347,9 @@ bench_result *bench_result_benchmarkconf(const char *section, const char *key, c char *bench_result_benchmarkconf_line(bench_result *b) { char *cpu_config = cpu_config_retranslate(b->machine->cpu_config, 1, 0); - char *ret = g_strdup_printf("%s=%.2f|%d|%s|%s|%s|%s|%d|%d|%d|%d|%s\n", - b->machine->mid, b->bvalue.result, b->bvalue.threads_used, + char *bv = bench_value_to_str(b->bvalue); + char *ret = g_strdup_printf("%s=%s|%d|%s|%s|%s|%s|%d|%d|%d|%d|%s\n", + b->machine->mid, bv, b->bvalue.threads_used, (b->machine->board != NULL) ? b->machine->board : "", b->machine->cpu_name, (b->machine->cpu_desc != NULL) ? b->machine->cpu_desc : "", @@ -355,6 +359,7 @@ char *bench_result_benchmarkconf_line(bench_result *b) { (b->machine->ogl_renderer != NULL) ? b->machine->ogl_renderer : "" ); free(cpu_config); + free(bv); return ret; } |