4 # Copyright (C) 2006 Jonathan Zarate
7 if (($#ARGV < 0) || ($#ARGV > 1)) {
8 print "Usage: sizehistory <filename> [datafile]\n";
13 $dname = ($ARGV[1] || $fname) . ".size";
15 print "\nSize history for $fname\n\n";
16 @size = `mipsel-linux-size $fname`;
18 if (($text, $data, $bss, $total) = $_ =~ /^\s*(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+/) {
19 $line = "$text\t$data\t$bss\t$total\t" . scalar localtime((stat($fname))[10]);
20 print "text\tdata\tbss\ttotal\ttime\n";
22 if (open(F
, "<$dname")) {
27 splice(@hist, 0, $#hist - 19);
30 if ($hist[$#hist] =~ /^(\d+)\t(\d+)\t(\d+)\t(\d+)\t/) {
31 if (($1 == $text) && ($2 == $data) && ($3 == $bss)) {
32 print "--- same size as last ---\n$line <= current\n";
35 printf "%d\t%d\t%d\t%d\t--- changes since above ---\n", ($text - $1), ($data - $2), ($bss - $3), ($total - $4);
42 if ((localtime((stat($dname))[9]))[7] != (localtime())[7]) {
43 open(F
, ">>$dname") || die "$dname: $!";