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/devices/arm/processor.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'modules/devices') diff --git a/modules/devices/arm/processor.c b/modules/devices/arm/processor.c index bcfb570e..0448f72a 100644 --- a/modules/devices/arm/processor.c +++ b/modules/devices/arm/processor.c @@ -323,16 +323,24 @@ gchar *processor_describe(GSList * processors) { gchar *processor_meta(GSList * processors) { gchar *meta_soc = processor_name(processors); gchar *meta_cpu_desc = processor_describe(processors); + gchar *meta_cpu_topo = processor_describe_default(processors); + gchar *meta_clocks = processor_frequency_desc(processors); gchar *ret = NULL; UNKIFNULL(meta_cpu_desc); ret = g_strdup_printf("[%s]\n" + "%s=%s\n" + "%s=%s\n" "%s=%s\n" "%s=%s\n", _("SOC/Package"), _("Name"), meta_soc, - _("Description"), meta_cpu_desc); + _("Description"), meta_cpu_desc, + _("Topology"), meta_cpu_topo, + _("Clocks"), meta_clocks ); g_free(meta_soc); g_free(meta_cpu_desc); + g_free(meta_cpu_topo); + g_free(meta_clocks); return ret; } @@ -351,10 +359,10 @@ gchar *processor_get_info(GSList * processors) for (l = processors; l; l = l->next) { processor = (Processor *) l->data; - tmp = g_strdup_printf(_("%s$CPU%d$%s=%.2fMHz\n"), + tmp = g_strdup_printf(_("%s$CPU%d$%s=%.2f%s\n"), tmp, processor->id, processor->model_name, - processor->cpu_mhz); + processor->cpu_mhz, _("MHz")); hashkey = g_strdup_printf("CPU%d", processor->id); moreinfo_add_with_prefix("DEV", hashkey, -- cgit v1.2.3