aboutsummaryrefslogtreecommitdiff
path: root/modules/benchmark.c
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2017-08-10 22:54:33 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2017-08-11 02:52:21 -0700
commitecdc375c54201be5776ce93d665ee77f74b1167a (patch)
treee7f1354d5587a58306a41ecd2b2f73b40e11f2f0 /modules/benchmark.c
parent242cf8f80c05d655c3ae6ce22ec3751668b11895 (diff)
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 <pburt0@gmail.com>
Diffstat (limited to 'modules/benchmark.c')
-rw-r--r--modules/benchmark.c14
1 files changed, 8 insertions, 6 deletions
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"
- "<big><b>This Machine</b></big>=%.3f|%s MHz\n"
+ "<big><b>%s</b></big>=%.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;