From 0700cb28c8c52a9cc675db648adddcf822af8652 Mon Sep 17 00:00:00 2001 From: Monte Copeland Date: Thu, 5 Jan 2012 13:36:20 -0600 Subject: 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 Reviewed-by: Monte K. Copeland --- src/build/tools/hb-parsedump.pl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/build/tools') diff --git a/src/build/tools/hb-parsedump.pl b/src/build/tools/hb-parsedump.pl index 9816eca8c..c190d3a2b 100755 --- a/src/build/tools/hb-parsedump.pl +++ b/src/build/tools/hb-parsedump.pl @@ -49,10 +49,12 @@ use File::Copy; #------------------------------------------------------------------------------ # 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 TRAC_BUFFER_SIZE_OFFSET => 20; +use constant TRAC_BUFFER_SIZE_SIZE => 4; #------------------------------------------------------------------------------ @@ -287,9 +289,17 @@ if ((0 != $addr) && (0 != $size)) #print "Component: $compName, $buffer, $compBufAddr\n"; $addr += DESC_ARRAY_ENTRY_ADDR_SIZE; + # read a portion of the buffer header to get its size + $buffer = readBinFile($hbDumpFile, + $compBufAddr+TRAC_BUFFER_SIZE_OFFSET, + TRAC_BUFFER_SIZE_SIZE); + my $compBufferSize = unpack('H*',$buffer); + $compBufferSize = hex $compBufferSize; + + #read the component trace buffer and save to file #read the component trace buffer - $buffer = readBinFile($hbDumpFile, $compBufAddr, TRAC_DEFAULT_BUFFER_SIZE); + $buffer = readBinFile($hbDumpFile, $compBufAddr, $compBufferSize ); chdir "$extDir"; -- cgit v1.2.1