From 201513a63d65596739a05dbc051916a284194715 Mon Sep 17 00:00:00 2001 From: Burt P Date: Tue, 9 Jul 2019 18:21:36 -0500 Subject: benchmark: add extra fields to result for revision and information * add an integer revision field * add an extra information string field * zlib benchmark: new revision[1] is 2, so that old results are obviously old, and now the zlib version string will be stored in extra information. [1] as of 6a8e19a14305079b03e45eeb0580a45104f300dd Signed-off-by: Burt P --- modules/benchmark.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'modules/benchmark.c') diff --git a/modules/benchmark.c b/modules/benchmark.c index 64f55e1f..efff08f1 100644 --- a/modules/benchmark.c +++ b/modules/benchmark.c @@ -44,20 +44,27 @@ static gchar *benchmark_include_results(bench_value result, const gchar * benchm static gboolean sending_benchmark_results = FALSE; char *bench_value_to_str(bench_value r) { - return g_strdup_printf("%lf; %lf; %d", r.result, r.elapsed_time, r.threads_used); + return g_strdup_printf("%lf; %lf; %d; %d; %s", r.result, r.elapsed_time, r.threads_used, r.revision, r.extra); } bench_value bench_value_from_str(const char* str) { bench_value ret = EMPTY_BENCH_VALUE; double r, e; - int t, c; + int t, c, v; + char extra[256]; if (str) { - c = sscanf(str, "%lf; %lf; %d", &r, &e, &t); + c = sscanf(str, "%lf; %lf; %d; %d; %255[^\r\n;|]", &r, &e, &t, &v, extra); if (c >= 3) { ret.result = r; ret.elapsed_time = e; ret.threads_used = t; } + if (c >= 4) { + ret.revision = v; + } + if (c >= 5) { + strcpy(ret.extra, extra); + } } return ret; } -- cgit v1.2.3