summaryrefslogtreecommitdiffstats
path: root/sys-utils/lscpu.c
diff options
context:
space:
mode:
authorHeiko Carstens2016-06-22 09:25:57 +0200
committerKarel Zak2016-06-24 10:54:09 +0200
commit4632b28811c9d2d63a90a78f79244ab614bd9033 (patch)
treef125db57629d20107c5d86d4b773ad2f5b3336ba /sys-utils/lscpu.c
parentlscpu: fix typo in summary output (diff)
downloadkernel-qcow2-util-linux-4632b28811c9d2d63a90a78f79244ab614bd9033.tar.gz
kernel-qcow2-util-linux-4632b28811c9d2d63a90a78f79244ab614bd9033.tar.xz
kernel-qcow2-util-linux-4632b28811c9d2d63a90a78f79244ab614bd9033.zip
lscpu: show static and dynamic MHz (s390)
s390 machines provide static and dynamic cpu mhz information via /proc/cpuinfo. The static cpu mhz is the normal cpu frequency a cpu is supposed to run with. The dynamic cpu mhz is the actual frequency a cpu is running with. This is usually the same as the static cpu mhz. Note that this values are different to the min/max mhz values available on other architecutes. The min/max values are unknown. This patch adds two new fields to the summary output which display these two values. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'sys-utils/lscpu.c')
-rw-r--r--sys-utils/lscpu.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index c07b9d096..9b87e0431 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -208,6 +208,8 @@ struct lscpu_desc {
int hyper; /* hypervisor vendor ID */
int virtype; /* VIRT_PARA|FULL|NONE ? */
char *mhz;
+ char *dynamic_mhz; /* dynamic mega hertz (s390) */
+ char *static_mhz; /* static mega hertz (s390) */
char **maxmhz; /* maximum mega hertz */
char **minmhz; /* minimum mega hertz */
char *stepping;
@@ -489,6 +491,8 @@ read_basicinfo(struct lscpu_desc *desc, struct lscpu_modifier *mod)
else if (lookup(buf, "model name", &desc->modelname)) ;
else if (lookup(buf, "stepping", &desc->stepping)) ;
else if (lookup(buf, "cpu MHz", &desc->mhz)) ;
+ else if (lookup(buf, "cpu MHz dynamic", &desc->dynamic_mhz)) ; /* s390 */
+ else if (lookup(buf, "cpu MHz static", &desc->static_mhz)) ; /* s390 */
else if (lookup(buf, "flags", &desc->flags)) ; /* x86 */
else if (lookup(buf, "features", &desc->flags)) ; /* s390 */
else if (lookup(buf, "type", &desc->flags)) ; /* sparc64 */
@@ -1718,6 +1722,10 @@ print_summary(struct lscpu_desc *desc, struct lscpu_modifier *mod)
print_s(_("Stepping:"), desc->stepping);
if (desc->mhz)
print_s(_("CPU MHz:"), desc->mhz);
+ if (desc->dynamic_mhz)
+ print_s(_("CPU dynamic MHz:"), desc->dynamic_mhz);
+ if (desc->static_mhz)
+ print_s(_("CPU static MHz:"), desc->static_mhz);
if (desc->maxmhz)
print_s(_("CPU max MHz:"), desc->maxmhz[0]);
if (desc->minmhz)