Nokia Networks Home

Nokia nmake Product Builder

Quick Links

Related Products

Tool Repository

[ tool index ]

tgreport.pl

Lists information about the triggered targets.

Download tgreport.pl

Description

tgreport.pl prints information about targets in a build log. It demonstrates several build log processing techniques in Perl.

Requirements

Perl 5.6
Exptools users can use /opt/exp/bin/perl.
XML::LibXML
A CPAN module used for loading and processing XML. Included in exptools, install on RHEL 6 using: yum install perl-XML-LibXML
Time::ParseDate
A CPAN module used for date/time parsing. Included in exptools, install on RHEL 6 using: yum install perl-Time-modules

Usage

perl tgreport.pl filename.xml

Example Command Line

perl tgreport.pl makelog.xml

Example Output

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

Script Description

tgreport.pl demonstrates several techniques for build log processing using Perl. The script provides examples showing how to

The script first parses and loads up the build log into a structure referenced by variable $doc. The script accesses vpath and 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 @tgs, 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).

Last Update: Friday,12-Aug-2016 12:17:11 EDT