diff options
author | Burt P <pburt0@gmail.com> | 2017-08-10 11:20:16 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2017-08-11 02:52:21 -0700 |
commit | 05c4a4c9451b7b07577255f7927cec6d70f2cf8d (patch) | |
tree | 1de5a3e76a59ecf4784f0fd15152690223c83ac0 /modules/devices/arm/processor.c | |
parent | 0b998d0cf01d497e998c17c251b241510ba38f3e (diff) |
Separate processor name and description + count cores and threads
* add cpu_procs_cores_threads() function to get counts from sysfs/topology
* each platform must now provide processor_name() and processor_describe()
* processor_name_default(): returns a list of unique processor->model_name
* processor_describe_default(): returns "N physical; M cores; L threads"
* processor_describe_by_counting_names(): returns a list of unique
processor->model_name with Nx prefix
(ex: "4x ARM Cortex A53 + 4x ARM Cortex A33")
* x86: _name and _describe use defaults
* arm: _name returns name of SOC, if available, _describe returns
processor_describe_by_counting_names()
* all other platforms: _name and _describe use defaults
* Computer module summary now shows both name and description for CPU
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/devices/arm/processor.c')
-rw-r--r-- | modules/devices/arm/processor.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/devices/arm/processor.c b/modules/devices/arm/processor.c index ed570006..bcfb570e 100644 --- a/modules/devices/arm/processor.c +++ b/modules/devices/arm/processor.c @@ -256,7 +256,7 @@ processor_get_detailed_info(Processor *processor) return ret; } -gchar *get_soc_name(GSList *processors) { +gchar *processor_name(GSList *processors) { /* compatible contains a list of compatible hardware, so be careful * with matching order. * ex: "ti,omap3-beagleboard-xm", "ti,omap3450", "ti,omap3"; @@ -312,14 +312,18 @@ gchar *get_soc_name(GSList *processors) { } } g_free(compat); + UNKIFNULL(ret); return ret; } +gchar *processor_describe(GSList * processors) { + return processor_describe_by_counting_names(processors); +} + gchar *processor_meta(GSList * processors) { - gchar *meta_soc = get_soc_name(processors); + gchar *meta_soc = processor_name(processors); gchar *meta_cpu_desc = processor_describe(processors); gchar *ret = NULL; - UNKIFNULL(meta_soc); UNKIFNULL(meta_cpu_desc); ret = g_strdup_printf("[%s]\n" "%s=%s\n" |