From 4632b28811c9d2d63a90a78f79244ab614bd9033 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Wed, 22 Jun 2016 09:25:57 +0200 Subject: 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 --- sys-utils/lscpu.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sys-utils/lscpu.c') 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) -- cgit v1.2.3-55-g7522