Lists information about the triggered targets.
tgreport.pl prints information about targets in a build log. It demonstrates several build log processing techniques in Perl.
yum install perl-XML-LibXML
yum install perl-Time-modules
perl tgreport.pl filename.xml
perl tgreport.pl makelog.xml
vpath /home/richb/projects/nightly/linux /home/richb/projects/nightly/source builddir /home/richb/projects/nightly/linux/src target-name almond1.o exit-code 0 start-time 12:56:32.822873 end-time 12:56:33.126217 duration 0.303344 pwd /home/richb/projects/nightly/linux/src/lib/libtr1 target-name apple1.o exit-code 0 start-time 12:56:33.311279 end-time 12:56:33.894835 duration 0.583556 pwd /home/richb/projects/nightly/linux/src/lib/libtr1 ... number of leaf targets found: 458 number of targets with non-zero exit code: 3
tgreport.pl demonstrates several techniques for build log processing using Perl. The script provides examples showing how to
vpathusing absolute paths.
The script first parses and loads up the build log into a structure referenced
$doc. The script accesses
builddir from fixed locations in the log XML structure and prints
them. Access is through absolute XPath paths like
/buildlog/makelog/makeinfo/vpath. The script then obtains a list
of leaf (bottom level) targets and assigns it to variable
using XPath expression
//tg[not (makelog)] to filter out targets
that just run recursive makes. The script iterates through the target list,
printing attributes for each target. Target durations are calculated by
converting start and end times to absolute seconds using the
secs() function and subtracting the values.
Additional information is printed for failed targets. Parent makefile elements
are obtained using the XPath
ancestor:: axis which navigates back
toward the root of the buildlog tree from the current target, and information
about each parent makefile is printed. A count of triggered targets in each
makefile is printed along with the name of each target. The failed job output
is accessed using XPath expression
text()[last()] which finds the
last child text node of the target (there are multiple child text elements
due to the "reason" codes stored prior to the job output).