From ecdc375c54201be5776ce93d665ee77f74b1167a Mon Sep 17 00:00:00 2001 From: Burt P Date: Thu, 10 Aug 2017 22:54:33 -0500 Subject: CPU Frequency Desc and benchmark result re-format Current CPU configurations aren't properly represented in Hardinfo. For SMT, each hardware thread is still reported as a CPU. Clusters with different CPU clock rates are not reported. It is common for ARM to pair a cluster of fast cores with a cluster of slower, but more power-efficient cores. These changes attempt to address this. The getProcessorFrequency method now returns the processor's max frequency for all its cores. While the new getProcessorFrequencyDesc lists each unique frequency with a prefix Nx with the count of cores at that freqency. Benchmark results have been reformated to use the de-prefixed getProcessorName and getProcessorFrequencyDesc. As an example from benchmark.conf: 4x AMD Phenom(tm) II X4 940 Processor | 800 MHz becomes: AMD Phenom(tm) II X4 940 Processor | 4x 800 MHz Which, I think, makes much more sense, as it works well with this kind of thing: Qualcomm Snapdragon 691 | 4x 1400 MHz + 4x 800 MHz Signed-off-by: Burt P --- modules/benchmark.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'modules/benchmark.c') diff --git a/modules/benchmark.c b/modules/benchmark.c index a32a8e4d..50fddf4d 100644 --- a/modules/benchmark.c +++ b/modules/benchmark.c @@ -192,7 +192,7 @@ static gchar *__benchmark_include_results(gdouble result, { GKeyFile *conf; gchar **machines; - gchar *path, *results = g_strdup(""), *return_value, *processor_frequency; + gchar *path, *results = g_strdup(""), *return_value, *processor_frequency, *processor_name; int i; conf = g_key_file_new(); @@ -223,7 +223,8 @@ static gchar *__benchmark_include_results(gdouble result, g_key_file_free(conf); if (result > 0.0f) { - processor_frequency = module_call_method("devices::getProcessorFrequency"); + processor_name = module_call_method("devices::getProcessorName"); + processor_frequency = module_call_method("devices::getProcessorFrequencyDesc"); return_value = g_strdup_printf("[$ShellParam$]\n" "Zebra=1\n" "OrderType=%d\n" @@ -233,12 +234,13 @@ static gchar *__benchmark_include_results(gdouble result, "ColumnTitle$TextValue=%s\n" /* CPU */ "ShowColumnHeaders=true\n" "[%s]\n" - "This Machine=%.3f|%s MHz\n" + "%s=%.3f|%s\n" "%s", order_type, - _("CPU Clock"), _("Results"), _("CPU"), + _("CPU Config"), _("Results"), _("CPU"), benchmark, - result, processor_frequency, results); + processor_name, result, processor_frequency, results); g_free(processor_frequency); + g_free(processor_name); } else { return_value = g_strdup_printf("[$ShellParam$]\n" "Zebra=1\n" @@ -250,7 +252,7 @@ static gchar *__benchmark_include_results(gdouble result, "ShowColumnHeaders=true\n" "[%s]\n%s", order_type, - _("CPU Clock"), _("Results"), _("CPU"), + _("CPU Config"), _("Results"), _("CPU"), benchmark, results); } return return_value; -- cgit v1.2.3