vlib: increase CPU base frequency precision 44/43144/3
authorSivaprasad Tummala <[email protected]>
Wed, 11 Jun 2025 10:21:43 +0000 (10:21 +0000)
committerDamjan Marion <[email protected]>
Fri, 13 Jun 2025 15:30:43 +0000 (15:30 +0000)
Updated the 'show cpu' CLI command to print the base frequency with 4 decimal
places instead of 2 (e.g., 2.69 GHz → 2.6945 GHz) for improved accuracy when
inspecting CPU timing characteristics

Type: improvement

Change-Id: I8f3384204ddcb8033aae9a1e1f6d06bed46478ab
Signed-off-by: Sivaprasad Tummala <[email protected]>
src/vlib/cli.c

index 38a8c2a..f66d57a 100644 (file)
@@ -980,8 +980,8 @@ show_cpu (vlib_main_t * vm, unformat_input_t * input,
   _("Model name", "%U", format_cpu_model_name);
   _("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);
+  _ ("Base frequency", "%.4f GHz",
+     ((f64) vm->clib_time.clocks_per_second) * 1e-9);
 #undef _
   return 0;
 }