diff options
| author | Dan Crowell <dcrowell@us.ibm.com> | 2012-04-03 15:35:56 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-04-27 13:15:05 -0500 |
| commit | abaf491814fa70cb24193eff4fae91919a25de4d (patch) | |
| tree | 691622ddefdd666d5a849fc27a979d0efd9ef46f /src/build/debug/Hostboot | |
| parent | f373d5d3ed00d94202f2b32d75f1066ff4727938 (diff) | |
| download | talos-hostboot-abaf491814fa70cb24193eff4fae91919a25de4d.tar.gz talos-hostboot-abaf491814fa70cb24193eff4fae91919a25de4d.zip | |
Attribute Dump Debug Func
You can request a dump of all attributes for a given target
using the HUID as the key. The command also allows you to
specify which trace buffer the output should go into.
Synopsis
hb-AttrDump ["options"]
Options:
huid HUID of target to dump (default is to dump all targets).
trace Trace buffer to use (default=g_trac_targ).
debug More debug output.
force Run command even if state does not appear correct.
Ex: dump the attributes for sys0node0proc0 into FSIR trace
hb-AttrDump "huid=0x00070001 trace=g_trac_fsir"
RTC: 35202
Change-Id: Iab3b50af025f203bd5184481462603de9b4bc1a9
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/912
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/build/debug/Hostboot')
| -rwxr-xr-x | src/build/debug/Hostboot/AttrDump.pm | 70 | ||||
| -rw-r--r-- | src/build/debug/Hostboot/CallFunc.pm | 56 |
2 files changed, 121 insertions, 5 deletions
diff --git a/src/build/debug/Hostboot/AttrDump.pm b/src/build/debug/Hostboot/AttrDump.pm new file mode 100755 index 000000000..8d8dfafa0 --- /dev/null +++ b/src/build/debug/Hostboot/AttrDump.pm @@ -0,0 +1,70 @@ + +use strict; + +package Hostboot::AttrDump; +use Exporter; +our @EXPORT_OK = ('main'); +require Hostboot::CallFunc; + +sub main +{ + my ($packName,$args) = @_; + + # Parse 'debug' option. + my $debug = 0; + if (defined $args->{"debug"}) + { + $debug = 1; + } + + # Parse 'force' argument. + my $force = 0; + if (defined $args->{"force"}) + { + $force = 1; + } + + # Parse 'trace' argument. + my $trace = (::findSymbolAddress("TARGETING::g_trac_targeting"))[0]; + if (defined $args->{"trace"}) + { + $trace = (::findSymbolAddress($args->{"trace"}))[0]; + } + if( $debug ) + { + my $tmp2 = $args->{"trace"}; + ::userDisplay("\ntrace: $trace ($tmp2)\n"); + } + + # Parse 'target' argument. + my $huid = 0; # dump all targets + if (defined $args->{"huid"}) + { + $huid = hex($args->{"huid"}); + } + if( $debug ) + { + ::userDisplay("huid: $huid\n"); + } + + my @dumpparms; + push( @dumpparms, $trace ); + push( @dumpparms, $huid ); + Hostboot::CallFunc::execFunc( "TARGETING::dumpAllAttributes2(trace_buf_head**, unsigned int)", $debug, $force, \@dumpparms ); + + return 0; +} + +sub helpInfo +{ + my %info = ( + name => "AttrDump", + intro => ["Dumps all Attributes to trace."], + options => { + "huid" => ["HUID of target to dump (default is to dump all targets)."], + "trace" => ["Trace buffer to use (default=g_trac_targ)."], + "force" => ["Run command even if state does not appear correct."], + "debug" => ["More debug output."], + }, + ); +} diff --git a/src/build/debug/Hostboot/CallFunc.pm b/src/build/debug/Hostboot/CallFunc.pm index a6e9bf417..64c5f8573 100644 --- a/src/build/debug/Hostboot/CallFunc.pm +++ b/src/build/debug/Hostboot/CallFunc.pm @@ -1,3 +1,25 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/build/debug/Hostboot/CallFunc.pm $ +# +# IBM CONFIDENTIAL +# +# COPYRIGHT International Business Machines Corp. 2011 - 2012 +# +# p1 +# +# 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. +# +# Origin: 30 +# +# IBM_PROLOG_END use strict; package Hostboot::CallFunc; @@ -66,12 +88,36 @@ sub main $force = 1; } + my $error = execFunc( $function, $debug, $force, @parms ); + if( $error ) + { + return; + } +} + +sub execFunc +{ + my $function = shift; + my $debug = shift; + my $force = shift; + my $parms_arg = shift; + my @parms = @{$parms_arg}; + + if( $debug ) + { + ::userDisplay("function = $function.\n"); + my $tmparg; + foreach $tmparg (@parms) + { + ::userDisplay("arg = $tmparg.\n"); + } + } # Ensure environment is in the proper state for running instructions. if (!::readyForInstructions()) { ::userDisplay "Cannot execute while unable to run instructions.\n"; - return; + return 1; } # Find symbol's TOC address. @@ -87,7 +133,7 @@ sub main if ((not defined $toc) || (not defined $address)) { ::userDisplay "Cannot find symbol to execute $function.\n"; - return; + return 1; } # Verify kernel isn't busy with an outstanding request. @@ -95,7 +141,7 @@ sub main (0 == $force)) { ::userDisplay "Another command is still pending.\n"; - return; + return 1; } # Write entry point (function TOC) and parameters into debug structure. @@ -136,9 +182,9 @@ sub main if (0 == ::read8($address + CALLFUNC_DEBUG_COMPLETE_OFFSET)) { ::userDisplay "Command failed to complete.\n"; - return; + return 1; } - + # Display return value. ::userDisplay ::read64($address + CALLFUNC_DEBUG_RETVAL_OFFSET)."\n"; } |

