From: Davidlohr Bueso Date: Tue, 17 Aug 2010 14:02:00 +0000 (-0400) Subject: lscpu: add byte order and bogoMIPS information X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b8d4d5f1818ede8f38eca74aef30a62e8e70ef3;p=util-linux lscpu: add byte order and bogoMIPS information Signed-off-by: Davidlohr Bueso Signed-off-by: Karel Zak --- diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index 58cd869d..ac66d2ec 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "cpuset.h" #include "nls.h" @@ -97,6 +98,7 @@ struct lscpu_desc { int virtype; /* VIRT_PARA|FULL|NONE ? */ char *mhz; char *stepping; + char *bogomips; char *flags; int mode; /* rm, lm or/and tm */ @@ -366,6 +368,7 @@ read_basicinfo(struct lscpu_desc *desc) else if (lookup(buf, "stepping", &desc->stepping)) ; else if (lookup(buf, "cpu MHz", &desc->mhz)) ; else if (lookup(buf, "flags", &desc->flags)) ; + else if (lookup(buf, "bogomips", &desc->bogomips)) ; else continue; } @@ -812,7 +815,13 @@ print_readable(struct lscpu_desc *desc, int hex) *(p - 2) = '\0'; print_s(_("CPU op-mode(s):"), buf); } - +#ifdef __BYTE_ORDER +#if (__BYTE_ORDER == __LITTLE_ENDIAN) + print_s(_("Byte Order:"), "Little Endian"); +#else + print_s(_("Byte Order:"), "Big Endian"); +#endif +#endif print_n(_("CPU(s):"), desc->ncpus); print_cpuset(hex ? _("On-line CPU(s) mask:") : @@ -858,6 +867,8 @@ print_readable(struct lscpu_desc *desc, int hex) print_s(_("Stepping:"), desc->stepping); if (desc->mhz) print_s(_("CPU MHz:"), desc->mhz); + if (desc->bogomips) + print_s(_("BogoMIPS:"), desc->bogomips); if (desc->virtflag) { if (!strcmp(desc->virtflag, "svm")) print_s(_("Virtualization:"), "AMD-V");