summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting/common/filter_out_unwanted_attributes.pl
diff options
context:
space:
mode:
authorChristian Geddes <crgeddes@us.ibm.com>2018-01-22 11:57:21 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-01-25 17:37:03 -0500
commitde1c2d1d9e39215b8c7012a0dbfde029de6bec2d (patch)
tree269c72dc6c5443dd2e299bec4744df5f6f1721c6 /src/usr/targeting/common/filter_out_unwanted_attributes.pl
parent4606e773441d4aca1e5cd0bde719d169c9050922 (diff)
downloadtalos-hostboot-de1c2d1d9e39215b8c7012a0dbfde029de6bec2d.tar.gz
talos-hostboot-de1c2d1d9e39215b8c7012a0dbfde029de6bec2d.zip
Remove annoying traces from target generation code
When building the targeting code it has been notoriously difficult to see what is going on. A large part of this has been due to these trace. This commit comments out some traces from the script filter_out_unwanted_attrributes.pl which will help debuging target build problems in the future Change-Id: I4c50c8b486a217140366ec6404b20619897d7dbb Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/52376 Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: ILYA SMIRNOV <ismirno@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/common/filter_out_unwanted_attributes.pl')
-rwxr-xr-xsrc/usr/targeting/common/filter_out_unwanted_attributes.pl33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/usr/targeting/common/filter_out_unwanted_attributes.pl b/src/usr/targeting/common/filter_out_unwanted_attributes.pl
index 3471529d2..843237b6b 100755
--- a/src/usr/targeting/common/filter_out_unwanted_attributes.pl
+++ b/src/usr/targeting/common/filter_out_unwanted_attributes.pl
@@ -6,7 +6,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2016,2017
+# Contributors Listed Below - COPYRIGHT 2016,2018
# [+] International Business Machines Corp.
#
#
@@ -40,11 +40,13 @@ use Getopt::Long qw(GetOptions);
my @tgt_files;
my $mrw_file;
my $help;
+my $verbose;
GetOptions(
"tgt-xml=s" => \@tgt_files,
"mrw-xml=s" => \$mrw_file,
"help" => \$help,
+ "verbose|v" => \$verbose,
);
if ((scalar @tgt_files eq 0) || ($mrw_file eq ""))
@@ -52,7 +54,9 @@ if ((scalar @tgt_files eq 0) || ($mrw_file eq ""))
print "ERROR: tgt-xml or mrw-xml is not specified\n";
print "tgt-xml: \n";
print Dumper @tgt_files;
+ print "\n";
print "mrw-xml: $mrw_file\n";
+ print "\n";
usage();
}
@@ -70,7 +74,8 @@ sub usage
print "Any attribute not referenced in hostboot's target_types.xml\n";
print "are deleted from mrw xml.\n";
print "Usage: ./filter_out_unwanted_attributes.pl --mrw-xml [mrw xml]\\\n";
- print " --tgt-xml [common target xml] <--tgt-xml [platform target xml]>\n";
+ print " --tgt-xml [common target xml] (optional --tgt-xml [platform target xml])\n";
+ print " --verbose (or -v)\n";
exit (-1);
}
@@ -233,8 +238,11 @@ $XML::LibXML::skipXMLDeclaration = 1;
my $parser = XML::LibXML->new();
my $mrw_parsed = $parser->parse_file($mrw_file);
-print "The following target and attribute pairs are being removed from";
-print " SYSTEM_hb.mrw.xml as they are not used by hostboot:\n";
+if($verbose)
+{
+ print "The following target and attribute pairs are being removed from";
+ print " SYSTEM_hb.mrw.xml as they are not used by hostboot:\n";
+}
#foreach targetInstance in the MRW file
foreach my $tgt
@@ -244,8 +252,11 @@ foreach my $tgt
if(!defined $tgt_xmls->{'targetType'}->{$tgt_type})
{
- print "Target of type: $tgt_type not found in the merged target XML!\n";
- print "Removing target $tgt\n";
+ if($verbose)
+ {
+ print "Target of type: $tgt_type not found in the merged target XML!\n";
+ print "Removing target $tgt\n";
+ }
$tgt->unbindNode();
next;
}
@@ -261,12 +272,18 @@ foreach my $tgt
{
#if the attribute is not found in any of the target_type
#xmls, then remove it from the mrw xml
- print "Removing Attr: $attr_id from Target: $tgt_type \n";
+ if($verbose)
+ {
+ print "Removing Attr: $attr_id from Target: $tgt_type \n";
+ }
$tgt->removeChild($attr);
}
else
{
- print "Found Attr $attr_id for Target Type $tgt_type\n";
+ if($verbose)
+ {
+ print "Found Attr $attr_id for Target Type $tgt_type\n";
+ }
}
}
}
OpenPOWER on IntegriCloud