Blame SOURCES/powerpc-utils-bc928b06.patch

956c23
commit bc928b06605371b72c7fe8ec7e81886114a9e9d4
956c23
Author: Sourabh Jain <sourabhjain@linux.ibm.com>
956c23
Date:   Thu Jan 31 14:25:21 2019 +0530
956c23
956c23
    lparstat: restrict the physc and entc attribute values to two decimal places
956c23
    
956c23
    Print format of physical processors consumed (physc) and percentage of
956c23
    the entitled capacity consumed (entc) attributes has changed from six
956c23
    decimal places to two.
956c23
    
956c23
    The least possible value allowed for processor entitlement to a LPAR
956c23
    is 0.05 so printing physc and entc values with such a high precision
956c23
    is incorrect.
956c23
    
956c23
    Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
956c23
    Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
956c23
    Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
956c23
956c23
diff --git a/src/lparstat.c b/src/lparstat.c
956c23
index ec57c1a..c9b86fd 100644
956c23
--- a/src/lparstat.c
956c23
+++ b/src/lparstat.c
956c23
@@ -176,7 +176,7 @@ void get_cpu_physc(struct sysentry *unused_se, char *buf)
956c23
 		physc = (new_purr - old_purr)/timebase/elapsed;
956c23
 	}
956c23
 
956c23
-	sprintf(buf, "%.6f", physc);
956c23
+	sprintf(buf, "%.2f", physc);
956c23
 }
956c23
 
956c23
 void get_per_entc(struct sysentry *unused_se, char *buf)
956c23
@@ -188,7 +188,7 @@ void get_per_entc(struct sysentry *unused_se, char *buf)
956c23
 	get_sysdata("DesEntCap", &descr, entc);
956c23
 	get_sysdata("physc", &descr, physc);
956c23
 
956c23
-	sprintf(buf, "%.6f", atof(physc) / atof(entc) * 100.0);
956c23
+	sprintf(buf, "%.2f", atof(physc) / atof(entc) * 100.0);
956c23
 }
956c23
 
956c23
 void get_cpu_app(struct sysentry *unused_se, char *buf)