Skip to content

Commit

Permalink
Remove annoying traces from target generation code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
crgeddes authored and dcrowell77 committed Jan 25, 2018
1 parent 4606e77 commit de1c2d1
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions src/usr/targeting/common/filter_out_unwanted_attributes.pl
Expand Up @@ -6,7 +6,7 @@
#
# OpenPOWER HostBoot Project
#
# Contributors Listed Below - COPYRIGHT 2016,2017
# Contributors Listed Below - COPYRIGHT 2016,2018
# [+] International Business Machines Corp.
#
#
Expand Down Expand Up @@ -40,19 +40,23 @@
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 ""))
{
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();
}

Expand All @@ -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);
}

Expand Down Expand Up @@ -233,8 +238,11 @@ sub usage
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
Expand All @@ -244,8 +252,11 @@ sub usage

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;
}
Expand All @@ -261,12 +272,18 @@ sub usage
{
#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";
}
}
}
}
Expand Down

0 comments on commit de1c2d1

Please sign in to comment.