From c123c31f979018eaa10d71131a8e9a915e1d7eb4 Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Sat, 30 Dec 2006 00:28:07 +0000 Subject: Show some results in bytes/second. Allow results to be sorted in reverse order. --- hardinfo2/benchmark.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'hardinfo2/benchmark.c') diff --git a/hardinfo2/benchmark.c b/hardinfo2/benchmark.c index 5cc23cdd..ed62ba19 100644 --- a/hardinfo2/benchmark.c +++ b/hardinfo2/benchmark.c @@ -40,7 +40,8 @@ static ModuleEntry hi_entries[] = { }; static gchar * -benchmark_include_results(gchar *results, const gchar *benchmark) +__benchmark_include_results(gchar *results, const gchar *benchmark, + ShellOrderType order_type) { GKeyFile *conf; gchar **machines, *bconf_path; @@ -61,9 +62,22 @@ benchmark_include_results(gchar *results, const gchar *benchmark) g_key_file_free(conf); g_free(bconf_path); - return g_strconcat("[$ShellParam$]\n" - "Zebra=1\n" - "ViewType=3\n", results, NULL); + return g_strdup_printf("[$ShellParam$]\n" + "Zebra=1\n" + "OrderType=%d\n" + "ViewType=3\n%s", order_type, results); +} + +static gchar * +benchmark_include_results_reverse(gchar *results, const gchar *benchmark) +{ + return __benchmark_include_results(results, benchmark, SHELL_ORDER_DESCENDING); +} + +static gchar * +benchmark_include_results(gchar *results, const gchar *benchmark) +{ + return __benchmark_include_results(results, benchmark, SHELL_ORDER_ASCENDING); } #include -- cgit v1.2.3