[Tinyos-2-commits] CVS: tinyos-2.x/tools/tinyos/misc tos-write-buildinfo.in, NONE, 1.1

Jan Beutel beutel at users.sourceforge.net
Fri Aug 17 08:48:33 PDT 2007


Update of /cvsroot/tinyos/tinyos-2.x/tools/tinyos/misc
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27026/tools/tinyos/misc

Added Files:
	tos-write-buildinfo.in 
Log Message:
added new extra target tos_buildinfo to create an xml file containing metrics and info of the builds, e.g. memory sizes

--- NEW FILE: tos-write-buildinfo.in ---
#!@pathperl@ -w
#
# This script generates an XML description of the buildinformation. This is 
# primarily used by other tools such as checkers, tests and continuous 
# integration.
#
#$Id: tos-write-buildinfo.in,v 1.1 2007/08/17 15:48:30 beutel Exp $
#@author Jan Beutel <j.beutel at ieee.org>
#
use strict;

my $MaxNameLength = 10;

if ( @ARGV == 0 ) {
  print "usage: tos-write-buildinfo [ident_flags] [exe_file]\n";
  exit 0;
}

my %ident_flags = ();
my $exe = "";
my $size = "avr-size";
my $platform = "";

for my $arg (@ARGV) {
  if ($arg =~ /^-DIDENT_(.+)=0x(.+)$/) {
    $ident_flags{lc($1)} = uc($2);
  }
  elsif ($arg =~ /^-DIDENT_(.+)="(.+)"$/) {
    $ident_flags{lc($1)} = $2;
  }
  elsif ($arg =~ /^--exe=(.+)$/) {
    $exe = $1;
  }
  elsif ($arg =~ /^--size=(.+)$/) {
    $size = $1;
  }
  elsif ($arg =~ /^--platform=(.+)$/) {
    $platform = $1;
  }
}


my @text;
my $rc2 = qx"$size $exe |grep main ";
#print $rc2;
print $size;
@text =  split(' ', $rc2);

print "<metrics>\n";
print "  <ram>";
print $text[1];
print "<ram>\n";
print "  <flash>";
print $text[0];
print "<flash>\n";
print "  <stack>";
print $text[2];
print "<stack>\n";
print "</metrics>\n";



More information about the Tinyos-2-commits mailing list