summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2018-12-30 11:07:36 -0800
committerDave Barach <openvpp@barachs.net>2019-01-02 12:23:59 +0000
commitd6897c1597c4f0904d5956f7d794e3f001d52f72 (patch)
treeabff82284c222aff921bb0b66f23e0ca21bfe1f3
parent461caa5f98202ac758076ad96b82c57251f2f19a (diff)
Add microarch details to 'show cpu'.
Change-Id: I31a3ff9e8f70468196c091027592a3aed2d09ac3 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
-rw-r--r--src/vlib/cli.c2
-rw-r--r--src/vppinfra/cpu.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/vlib/cli.c b/src/vlib/cli.c
index d7b2a4686d1..4c33914e8cc 100644
--- a/src/vlib/cli.c
+++ b/src/vlib/cli.c
@@ -852,7 +852,7 @@ show_cpu (vlib_main_t * vm, unformat_input_t * input,
{
#define _(a,b,c) vlib_cli_output (vm, "%-25s " b, a ":", c);
_("Model name", "%U", format_cpu_model_name);
- _("Microarchitecture", "%U", format_cpu_uarch);
+ _("Microarch model (family)", "%U", format_cpu_uarch);
_("Flags", "%U", format_cpu_flags);
_("Base frequency", "%.2f GHz",
((f64) vm->clib_time.clocks_per_second) * 1e-9);
diff --git a/src/vppinfra/cpu.c b/src/vppinfra/cpu.c
index ef08dc7c022..1b3ac31ef91 100644
--- a/src/vppinfra/cpu.c
+++ b/src/vppinfra/cpu.c
@@ -74,15 +74,17 @@ format_cpu_uarch (u8 * s, va_list * args)
{
#if __x86_64__
u32 __attribute__ ((unused)) eax, ebx, ecx, edx;
- u8 model, family;
+ u8 model, family, stepping;
if (__get_cpuid (1, &eax, &ebx, &ecx, &edx) == 0)
return format (s, "unknown (missing cpuid)");
model = ((eax >> 4) & 0x0f) | ((eax >> 12) & 0xf0);
family = (eax >> 8) & 0x0f;
+ stepping = eax & 0x0f;
-#define _(f,m,a,c) if ((model == m) && (family == f)) return format(s, "%s (%s)", a, c);
+#define _(f,m,a,c) if ((model == m) && (family == f)) return \
+format(s, "[0x%x] %s ([0x%02x] %s) stepping 0x%x", f, a, m, c, stepping);
foreach_x86_cpu_uarch
#undef _
return format (s, "unknown (family 0x%02x model 0x%02x)", family, model);