summaryrefslogtreecommitdiffstats
path: root/src/build/buildpnor/PnorUtils.pm
diff options
context:
space:
mode:
authorMegan <megan.teo@ibm.com>2019-08-07 15:08:24 -0500
committerWilliam G Hoffa <wghoffa@us.ibm.com>2019-08-28 15:19:29 -0500
commitade048149809eedef4190d7ad063eed3800d377a (patch)
treeb56d543e9118abee73ead2a5aa7a8270b85714b7 /src/build/buildpnor/PnorUtils.pm
parent4536704918f346016d5e2d6091dd8f5c33f8c4b1 (diff)
downloadtalos-hostboot-ade048149809eedef4190d7ad063eed3800d377a.tar.gz
talos-hostboot-ade048149809eedef4190d7ad063eed3800d377a.zip
Alert when a partition's space utilization exceeds a threshold
Calculate the percentage utilization of a pnor partition by using binary file size + header size + ecc overhead (if used for partition). User is warned when a pnor partition exceeds a specific utilization threshold Change-Id: I00b0b69a039ffefdf086dc470fd0f76b72ee267d RTC: 212220 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/81990 Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E Bofferding <bofferdn@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: William G Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/build/buildpnor/PnorUtils.pm')
-rw-r--r--src/build/buildpnor/PnorUtils.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/build/buildpnor/PnorUtils.pm b/src/build/buildpnor/PnorUtils.pm
index d0f5cd05f..6128c298b 100644
--- a/src/build/buildpnor/PnorUtils.pm
+++ b/src/build/buildpnor/PnorUtils.pm
@@ -409,6 +409,8 @@ sub checkSpaceConstraints
my %sectionHash = %{$$i_pnorLayoutRef{sections}};
+ print "Note: the following metrics are not a true representation of section utilization, since some sections are substantially padded before applying ECC\n";
+
for $key ( keys %{$i_binFiles})
{
my $filesize = -s $$i_binFiles{$key};
@@ -422,9 +424,8 @@ sub checkSpaceConstraints
my $eyeCatch = $sectionHash{$layoutKey}{eyeCatch};
my $physicalRegionSize = $sectionHash{$layoutKey}{physicalRegionSize};
- my $pctUtilized = sprintf("%.2f", $filesize / $physicalRegionSize * 100);
my $freeBytes = $physicalRegionSize - $filesize;
- print "$eyeCatch is $pctUtilized% utilized ($freeBytes of $physicalRegionSize bytes free)\n";
+ print "$eyeCatch section size: $physicalRegionSize, bytes used: $filesize, bytes unused: $freeBytes\n";
if($filesize > $physicalRegionSize)
{
OpenPOWER on IntegriCloud