summaryrefslogtreecommitdiffstats
path: root/src/build/debug/Hostboot/PageMgr.pm
diff options
context:
space:
mode:
Diffstat (limited to 'src/build/debug/Hostboot/PageMgr.pm')
-rwxr-xr-x[-rw-r--r--]src/build/debug/Hostboot/PageMgr.pm51
1 files changed, 36 insertions, 15 deletions
diff --git a/src/build/debug/Hostboot/PageMgr.pm b/src/build/debug/Hostboot/PageMgr.pm
index 0a279f6b6..db25a47d6 100644..100755
--- a/src/build/debug/Hostboot/PageMgr.pm
+++ b/src/build/debug/Hostboot/PageMgr.pm
@@ -1,26 +1,26 @@
#!/usr/bin/perl
-# IBM_PROLOG_BEGIN_TAG
-# This is an automatically generated prolog.
+# IBM_PROLOG_BEGIN_TAG
+# This is an automatically generated prolog.
#
-# $Source: src/build/debug/Hostboot/PageMgr.pm $
+# $Source: src/build/debug/Hostboot/PageMgr.pm $
#
-# IBM CONFIDENTIAL
+# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2012
+# COPYRIGHT International Business Machines Corp. 2012,2013
#
-# p1
+# p1
#
-# Object Code Only (OCO) source materials
-# Licensed Internal Code Source Materials
-# IBM HostBoot Licensed Internal Code
+# Object Code Only (OCO) source materials
+# Licensed Internal Code Source Materials
+# IBM HostBoot Licensed Internal Code
#
-# The source code for this program is not published or other-
-# wise divested of its trade secrets, irrespective of what has
-# been deposited with the U.S. Copyright Office.
+# The source code for this program is not published or otherwise
+# divested of its trade secrets, irrespective of what has been
+# deposited with the U.S. Copyright Office.
#
-# Origin: 30
+# Origin: 30
#
-# IBM_PROLOG_END_TAG
+# IBM_PROLOG_END_TAG
use strict;
@@ -35,7 +35,6 @@ use constant PAGEMGR_PAGES_AVAIL_OFFSET => 0;
use constant PAGEMGR_BUCKETS_OFFSET => 8;
use constant PAGEMGR_NUMBER_OF_BUCKETS => 16;
-
sub main
{
my ($packName, $args) = @_;
@@ -46,6 +45,11 @@ sub main
{
$debug = 1;
}
+ my $showpages = 0;
+ if (defined $args->{"showpages"})
+ {
+ $showpages = 1;
+ }
# Find the PageManager
my ($symAddr, $symSize) = ::findSymbolAddress(PAGEMGR_INSTANCE_NAME);
@@ -76,6 +80,10 @@ sub main
::userDisplay "Bucket $bucket has $stackCount blocks for ".
"$size pages.\n" if $debug;
+
+ if( $debug && $showpages ) {
+ showPagesInStack($stackAddr,(1 << $bucket));
+ }
}
::userDisplay "Pages in buckets: ".$pagesInBuckets."\n";
@@ -97,6 +105,19 @@ sub countItemsInStack
return 1 + countItemsInStack(::read64($stack));
}
+sub showPagesInStack
+{
+ my $stack = shift;
+ my $bucketsize = shift;
+
+ return 0 if (0 == $stack);
+
+ ::userDisplay(sprintf "..mem=0x%.16X..0x%.16X : %d\n",
+ $stack, $stack+4096*$bucketsize, $bucketsize );
+
+ return 1 + showPagesInStack(::read64($stack),$bucketsize);
+}
+
sub helpInfo
{
my %info = (
OpenPOWER on IntegriCloud