]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: show static and dynamic MHz (s390)
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 22 Jun 2016 07:25:57 +0000 (09:25 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 24 Jun 2016 08:54:09 +0000 (10:54 +0200)
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>
sys-utils/lscpu.c
tests/expected/lscpu/lscpu-s390-lpar-drawer

index c07b9d09683af44d546c2ae86781af658e8812bc..9b87e0431bac38100b87a222859ba9bbc92f42f4 100644 (file)
@@ -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)
index accbff8210655c9ab0b13dcea9c0f0ded7f2a412..88fe1009ea0a322a2beadc66a34d7d28fbf65a61 100644 (file)
@@ -9,6 +9,8 @@ Drawer(s):             4
 NUMA node(s):          1
 Vendor ID:             IBM/S390
 Model name:            0
+CPU dynamic MHz:       5000
+CPU static MHz:        5000
 BogoMIPS:              20325.00
 Hypervisor:            PR/SM
 Hypervisor vendor:     IBM