summaryrefslogtreecommitdiffstats
path: root/src/build/vpo/hb-virtdebug.pl
diff options
context:
space:
mode:
authorMonte Copeland <copelanm@us.ibm.com>2012-01-05 13:36:20 -0600
committerMonte K. Copeland <copelanm@us.ibm.com>2012-01-09 09:40:15 -0600
commit0700cb28c8c52a9cc675db648adddcf822af8652 (patch)
tree8df613d88689838ae0386f776f4e1e5135685702 /src/build/vpo/hb-virtdebug.pl
parenta8ac662f8643211032077043eace4b92108fc5fe (diff)
downloadtalos-hostboot-0700cb28c8c52a9cc675db648adddcf822af8652.tar.gz
talos-hostboot-0700cb28c8c52a9cc675db648adddcf822af8652.zip
Perl fixes for variable-sized trace buffers.
Change-Id: I40e5efaba9bde0a2b75b8cd5b316f7b8642db8bd Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/594 Tested-by: Jenkins Server Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Monte K. Copeland <copelanm@us.ibm.com>
Diffstat (limited to 'src/build/vpo/hb-virtdebug.pl')
-rwxr-xr-xsrc/build/vpo/hb-virtdebug.pl27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/build/vpo/hb-virtdebug.pl b/src/build/vpo/hb-virtdebug.pl
index 5636f93b3..2a45ea6e1 100755
--- a/src/build/vpo/hb-virtdebug.pl
+++ b/src/build/vpo/hb-virtdebug.pl
@@ -42,11 +42,13 @@ use Cwd;
#------------------------------------------------------------------------------
# Constants
#------------------------------------------------------------------------------
-use constant MAX_NUM_TRACE_BUFFERS => 24;
+use constant MAX_NUM_TRACE_BUFFERS => 48;
use constant DESC_ARRAY_ENTRY_ADDR_SIZE => 8;
use constant DESC_ARRAY_ENTRY_COMP_NAME_SIZE => 16;
use constant TRAC_DEFAULT_BUFFER_SIZE => 0x0800;
use constant CACHE_LINE_SIZE => 128;
+use constant TRAC_BUFFER_SIZE_OFFSET => 20;
+use constant TRAC_BUFFER_SIZE_SIZE => 4;
#------------------------------------------------------------------------------
@@ -399,8 +401,29 @@ if ($dumpTrace)
print "$command\n";
die if (system("$command") != 0);
+ # Get the length of the buffer from the component trace header
+ $buffer = readBinFile( "$outDir/trace.out",
+ $offset+TRAC_BUFFER_SIZE_OFFSET,
+ TRAC_BUFFER_SIZE_SIZE );
+
+ my $compBufferSize=unpack('H*',$buffer);
+ $compBufferSize = hex $compBufferSize;
+
+ # Re-read trace buffer using correct buffer size
+ $offset = $compBufAddr % CACHE_LINE_SIZE;
+ $cacheLines = ceil( $compBufferSize / CACHE_LINE_SIZE);
+ if ($offset != 0)
+ {
+ $cacheLines += 1;
+ }
+ #print "$compName, addr $compBufAddr, offset $offset, cacheLines $cacheLines\n";
+ $command = sprintf ("p8_dump_l3 %x $cacheLines -f $outDir/trace.out -b @ecmdOpt",
+ $compBufAddr);
+ print "$command\n";
+ die if (system("$command") != 0);
+
#Extract just the component trace
- $buffer = readBinFile("$outDir/trace.out", $offset, TRAC_DEFAULT_BUFFER_SIZE);
+ $buffer = readBinFile("$outDir/trace.out", $offset, $compBufferSize);
#Append to tracBIN
appendBinFile("$outDir/tracBIN", $buffer);
OpenPOWER on IntegriCloud