aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/perfmon/intel/bundle
diff options
context:
space:
mode:
authorRay Kinsella <mdr@ashroe.eu>2021-01-21 18:39:26 +0000
committerDamjan Marion <dmarion@me.com>2021-03-16 21:37:20 +0000
commite4551ffc4860ec8bc57753042f9983450f096a52 (patch)
tree79c55452403f093c26133f9fe3901fae88b49e85 /src/plugins/perfmon/intel/bundle
parent5e798bce421aaae093ef795c0812420c83cddda6 (diff)
perfmon: fixes for cache hierarchy
Account for occasional instances with the misses rates between caches are inconsistent. Type: fix Signed-off-by: Ray Kinsella <mdr@ashroe.eu> Change-Id: Idfb8bb7543401405cfe04291ad201c28be030cc9
Diffstat (limited to 'src/plugins/perfmon/intel/bundle')
-rw-r--r--src/plugins/perfmon/intel/bundle/cache_hit_miss.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/perfmon/intel/bundle/cache_hit_miss.c b/src/plugins/perfmon/intel/bundle/cache_hit_miss.c
index b3d6eebe04c..0fb24c59b6b 100644
--- a/src/plugins/perfmon/intel/bundle/cache_hit_miss.c
+++ b/src/plugins/perfmon/intel/bundle/cache_hit_miss.c
@@ -27,24 +27,28 @@ format_intel_core_cache_hit_miss (u8 *s, va_list *args)
switch (row)
{
case 0:
- s = format (s, "%.2f", (f64) ns->value[0] / ns->n_packets);
+ s = format (s, "%0.2f", (f64) ns->value[0] / ns->n_packets);
break;
case 1:
- s = format (s, "%.2f", (f64) ns->value[1] / ns->n_packets);
+ s = format (s, "%0.2f", (f64) ns->value[1] / ns->n_packets);
break;
case 2:
- s = format (s, "%.2f",
- (f64) (ns->value[1] - ns->value[2]) / ns->n_packets);
+ s =
+ format (s, "%0.2f",
+ (f64) (ns->value[1] - clib_min (ns->value[1], ns->value[2])) /
+ ns->n_packets);
break;
case 3:
- s = format (s, "%.2f", (f64) ns->value[2] / ns->n_packets);
+ s = format (s, "%0.2f", (f64) ns->value[2] / ns->n_packets);
break;
case 4:
- s = format (s, "%.2f",
- (f64) (ns->value[2] - ns->value[3]) / ns->n_packets);
+ s =
+ format (s, "%0.2f",
+ (f64) (ns->value[2] - clib_min (ns->value[2], ns->value[3])) /
+ ns->n_packets);
break;
case 5:
- s = format (s, "%.2f", (f64) ns->value[3] / ns->n_packets);
+ s = format (s, "%0.2f", (f64) ns->value[3] / ns->n_packets);
break;
}