diff options
author | Peter Schiffer <pschiffe@redhat.com> | 2013-03-26 15:35:34 +0100 |
---|---|---|
committer | Peter Schiffer <pschiffe@redhat.com> | 2013-03-26 15:35:34 +0100 |
commit | c47c5c19c5857439db30e40d4a691f5b700adf5f (patch) | |
tree | 2cf25719bd0a4e87d56a51cf19cf7d509507a222 /src/hardware/dmidecode.c | |
parent | 338db1b89aa1276f5c57ba4f970df3c28bfb03ec (diff) | |
download | openlmi-providers-c47c5c19c5857439db30e40d4a691f5b700adf5f.tar.gz openlmi-providers-c47c5c19c5857439db30e40d4a691f5b700adf5f.tar.xz openlmi-providers-c47c5c19c5857439db30e40d4a691f5b700adf5f.zip |
Hardware: added new providers
Providers added:
* LMI_ProcessorCapabilitiesProvider
* LMI_ProcessorElementCapabilitiesProvider
Diffstat (limited to 'src/hardware/dmidecode.c')
-rw-r--r-- | src/hardware/dmidecode.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/hardware/dmidecode.c b/src/hardware/dmidecode.c index 6a038fb..14e4ac9 100644 --- a/src/hardware/dmidecode.c +++ b/src/hardware/dmidecode.c @@ -34,7 +34,9 @@ void init_dmiprocessor_struct(DmiProcessor *cpu) cpu->max_speed = 0; cpu->external_clock = 0; cpu->name = NULL; + cpu->cores = 1; cpu->enabled_cores = 1; + cpu->threads = 1; cpu->type = NULL; cpu->stepping = NULL; cpu->upgrade = NULL; @@ -204,6 +206,14 @@ short dmi_get_processors(DmiProcessor **cpus, unsigned *cpus_nb) buf = NULL; continue; } + /* Cores */ + buf = copy_string_part_after_delim(buffer[i], "Core Count: "); + if (buf) { + sscanf(buf, "%u", &cpus[curr_cpu]->cores); + free(buf); + buf = NULL; + continue; + } /* Enabled Cores */ buf = copy_string_part_after_delim(buffer[i], "Core Enabled: "); if (buf) { @@ -212,6 +222,14 @@ short dmi_get_processors(DmiProcessor **cpus, unsigned *cpus_nb) buf = NULL; continue; } + /* Threads */ + buf = copy_string_part_after_delim(buffer[i], "Thread Count: "); + if (buf) { + sscanf(buf, "%u", &cpus[curr_cpu]->threads); + free(buf); + buf = NULL; + continue; + } /* CPU Type/Role */ buf = copy_string_part_after_delim(buffer[i], "Type: "); if (buf) { |