diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2012-10-05 12:54:47 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-11-07 14:18:17 -0600 |
commit | 20812c9a9c7c1a46a425d5cd5b207d88f81a6ba1 (patch) | |
tree | fbbd37b9140ff44fd392315d606023b9f90d55f5 /src/build/debug/Hostboot/PageMgr.pm | |
parent | bf56ed5337bbc85eec044f2659eefbc2ad17f73f (diff) | |
download | blackbird-hostboot-20812c9a9c7c1a46a425d5cd5b207d88f81a6ba1.tar.gz blackbird-hostboot-20812c9a9c7c1a46a425d5cd5b207d88f81a6ba1.zip |
PageMgr and MemStats debug tool enhancements.
Change-Id: I138b4ccd7930912336487bdf3247d581e4a51b94
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/6777
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build/debug/Hostboot/PageMgr.pm')
-rwxr-xr-x[-rw-r--r--] | src/build/debug/Hostboot/PageMgr.pm | 51 |
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 = ( |